1function checkObj(obj, checkProp) {
2 if(obj.hasOwnProperty(checkProp)){
3 return obj[checkProp];
4 }else{
5 return "Not Found"
6 }
7}
1var myObj = {
2 top: "hat",
3 bottom: "pants"
4};
5myObj.hasOwnProperty("top"); // true
6myObj.hasOwnProperty("middle"); // false