JavaScript in operator....
=> JavaScript in operator. It's use to identifyee any value include in this Object or Array. When use in for Object than we are use key before in operator and use after this Object name.
=> When use in for Array. Than use index number before in operator and after Array name.
const myObject = {
apple: 2,
banana: 3,
}
console.log("apple" in myObject);
const myArrey = ['apple','Banana','Mangow'];
console.log(1 in myArrey);
Comments
Post a Comment