Is there any method to return a bool for this example instead of one of the operands?
var json = {"test":"asd", "example":"fgh"};
var exists = json.test && json.example;
console.log(exists); // returns 'fgh'
console.log(json.test && json.example); // returns 'fgh'
To achieve the equivalent of:
var json = {"test":"asd", "example":"fgh"};
var exists= json.hasOwnProperty("test") && json.hasOwnProperty("example");
console.log(exists); // returns true