Answers for "check many keys in objects"

0

check many keys in objects

const neededKeys = ['oldPassword', 'name', 'newPassword'];

const obj = {
    "name": "[email protected]",
    "oldPassword": "1234",
    "newPassword": "12345"
}

console.log(neededKeys.every(key => Object.keys(obj).includes(key)));
Posted by: Guest on July-06-2021

Code answers related to "check many keys in objects"

Browse Popular Code Answers by Language