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: Muhammadvar 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
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
Top User Interface Expert Questions
☺ | Explain what is the difference between linking to an image, a website, and an email address? |
☺ | What is something new / something you have found interesting recently? |
☺ | Name some online resources you reference when having CSS issues? |
☺ | Tell me why did you get into coding, programming, etc.? |
Top Graphical User Interface (GUI) Categories
☺ | User Interface Expert Interview Questions. |
☺ | Front End Programmer Interview Questions. |
☺ | Lead Web Designer Interview Questions. |
☺ | Senior Graphics Designer Interview Questions. |
☺ | Web Designer Freelance Interview Questions. |