Skip to content

Instantly share code, notes, and snippets.

View amithld's full-sized avatar

Amit Bisht amithld

View GitHub Profile
@amithld
amithld / gist:010493105571c17f8c12e74804fe85d0
Created August 5, 2016 12:53
what is wrong with the code? :- Modify the function checkObj to test myObj for checkProp. If the property is found, return that property's value. If not, return "Not Found".
var myObj = {
gift: "pony",
pet: "kitten",
bed: "sleigh"
};
function checkObj(checkProp) {
// Your Code Here
if(myObj.hasOwnProperty("checkProp"))
{