for in loop key code example
Example: for in loop key
// if you want to get the 'value' of the key you can do it this way
const user = {firstName: 'John', lastName: 'Doe'}
for(key in user) console.log(user[key]);
// output :
// John
// Doe
// if you want to get the 'value' of the key you can do it this way
const user = {firstName: 'John', lastName: 'Doe'}
for(key in user) console.log(user[key]);
// output :
// John
// Doe