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

world tourism guide Template

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