How to check key exists in object es6

How to check if a particular key exists in a JavaScript object?

const result = myArr["rate"] === undefined;

Or

const result = myArr.hasOwnProperty("rate");


Comments

Popular posts from this blog

How to Remove Duplicates from Array in Javascript ES6

Es6 how to check if value is not null or undefined?