I want to get a boolean from an Object.entries(b).foreach but I don't know how to retrieve it.
Like :
const body = {a:1,b:2}
function handle() {
let myBool = true;
Object.entries(body).forEach(([key, value]) => {
myBool = false;
});
return myBool;
}
So, that's always return true, I tried something like
const body = {a:1,b:2}
function handle() {
return Object.entries(body).forEach(([key, value]) => {
return false;
});
}
But it doesn't work. it's probably a lack of understanding JS, can you give me a hint ?