an object
we like to iterate over the toBlock find the keys and values right?
two way to do that:
const toBlockKeys = Object.keys(obj.toBlock); //get the keys
toBlockKeys.forEach(x => {
console.log(obj.toBlock[x]); // obj.toBlock[x] will give you the value and x give you the key thing
});
and the other way:
for(let x in obj.toBlock){
console.log(x); // this will give you the key
console.log(obj.toBlock[x]); // this will give you the value
}
thank you so much man. i really appreciate this
Обсуждают сегодня