js json check if key exist using '?' 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: if don't exist key json php
<?php
$search_array = array('first' => 1, 'second' => 4);
if (array_key_exists('first', $search_array)) {
echo "The 'first' element is in the array";
}
?>