I have some questions about my code. My code look like this
var data = {"Q1":"Male","Q5":"USA"};
var combine = [ {"Q1":"Male","Q5":"USA"},
{"Q1":"Male","Q5":"Japan"}];
for(key in combine[0]){
if(key.length > 1){
var num = key.length;
console.log(key, data.key);
}
}
My purpose is try to return data.Q1 and data.Q2 with use data.key but when i console.log(key, data.key);
Keys are Q1, Q5 but data.key is undefined i think its must be "Male" and "USA"