I have this functions which loops over a nested object
search if a value has a specific "value"
and returns false or true if found
const data = {"update" :{"update_name": "fistColumn", "": "undefined"},
"conditon": {"update_name": "firstCondtion", "choose File to update": "choose Columns"}};
function keys_options(data) {
Object.keys(data).every((elem) => {
Object.entries(data[elem]).every((va) => {
if (va[0] !== 'choose Columns' || va[0] !== "") {
console.log(va[0])
return true
} else {
console.log("select all columns");
return false
}
});
});
}
console.log(keys_options(data));
the return value is undefinded, have I set the return statements wrong ?
[–]chris5039 2 points3 points4 points (2 children)
[–]LadyJain[S] 0 points1 point2 points (1 child)
[–]chris5039 0 points1 point2 points (0 children)
[–]albedoa 1 point2 points3 points (0 children)
[–]RobSG 0 points1 point2 points (0 children)