0


let checkExistance = "a" in ["a","b","c","e"];

console.log(checkExistance)// returns false

// wh`your text`y 

/I tried the in operator in JavaScript to create a function that takes two parameters an object and property to be removed. I used the in operator to check if the item or property I want to remove exists or not. But the in operator behaves diffently./

  • For arrays, you should use [`.includes()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/includes) to check if it contains your value. – Nick Parsons Jul 29 '23 at 05:37

0 Answers0