Evalulate if key in Javascript object
Sometimes you want to find if a JS object has a property but don't necessarily care what the value is. Use the in
operator.
const myObject = { something: 42 };
> 'something' in myObject
> true
Tweet