Loop through the "me" object and print each value to the console without assuming you know the keys. Extra bonus: print each color in a separate console.log() without assuming you know the key of "fcolors" (detect the array, and handle printing the values of the array?

Submitted by: Muhammad
var me = {"fname": "Global", "lname": "Guideline", "fcolors": ["blue", "green", "whitesmoke"]};
for (var key in me){
if(me.hasOwnProperty(key)){
if(me[key] instanceof Array){
for( var i =0; i < me[key].length; i++ ){
console.log(me[key][i]);
}
} else {
console.log(me[key]);
}
}
}
Submitted by: Muhammad

Read Online User Interface Expert Job Interview Questions And Answers