how to check if json contains a key in javascript code example Example: check if json obj exists if(thisSession.hasOwnProperty('merchant_id')){ }