Handy JS in operator

The ‘in’ operator can help to check if an Array contains specified index or an Object contains a specified key.

Checking if index exists in an Array:

Checking if an Object contains a property: