check if key exists in json array javascript code example
Example 1: check if key exists in json typescript
if (cell.hasOwnProperty('Relationships')) {
console.log("Key Found!!");
}
else {
console.log("Not Found.");
}
Example 2: check if json obj exists
if(thisSession.hasOwnProperty('merchant_id')){
}
Example 3: check if a key exists in an object javascript
"key" in obj // true, regardless of the actual value