I have a json as
var days = {mon: 1, tue:1, fri: 1}
What I'm trying to do it
var dayswithone =[];
['mon','tue','wed','thur','fri'].forEach(function(day){
if(days.day){
dayswithone.push(day);
}
});
All i have to do is push days with 1 into array dayswithone. But this is giving me days.day as undefined.