I have object a and object b .I want to check key of b exist in a or not without using loop how can I do this.
var a = {name1: "hello", game1: "no games", name2: "world"}
var b = {name1:'hello world'}
Yes I can do this using loop. First I can get all the keys of b in array and i can take each key at a time and find by using .hasOwnProperty() but I am looking for the method without using loop how is it possible.
Object.keys(b)[0] in a, but ifbhas more than one key then you will need a loop, no way around that.