Complete the code to loop through each block in the blockchain.
for block in [1] { // process block }
The variable blockchain holds the list of blocks to loop through.
Complete the code to print the hash of each block in the blockchain.
for block in blockchain { print([1]); }
The hash property of each block contains its unique hash value.
Fix the error in the for loop to correctly iterate over the blockchain array.
for (let [1] = 0; [1] < blockchain.length; [1]++) { console.log(blockchain[[1]].hash); }
The variable i is the conventional index variable used in for loops.
Fill both blanks to create a dictionary of block hashes and their data for blocks with index greater than 0.
const blockData = {
[1]: blockchain[[2]].data
for [2] in blockchain if blockchain[[2]].index > 0
};Use blockIndex as the loop variable and access the hash and data by index.
Fill both blanks to filter blocks with data value greater than 100 and create a new list of their hashes.
const filteredHashes = blockchain.filter(block => block.data [1] 100).map(block => block.[2]);
Use > to filter blocks with data greater than 100 and map to their hash.