Answers for "get keys wher value is true in object in javascript"

0

get keys wher value is true in object in javascript

var obj = {1001: true, 1002: false};

var keys = Object.keys(obj);

var filtered = keys.filter(function(key) {
    return obj[key]
});
Posted by: Guest on May-03-2020

Code answers related to "get keys wher value is true in object in javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language