Basic JavaScript: Testing Objects for Properties | freeCodeCamp.org

EMBED

Thu Sep 29 2022 21:37:48 GMT+0000 (Coordinated Universal Time)

Saved by @chymax030 #javascript


function checkObj(obj, checkProp) { // Only change code below this line if (obj.hasOwnProperty(checkProp)) { return obj[checkProp]; } else { return "Not Found"; } return "Change Me!"; // Only change code above this line }

https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/basic-javascript/testing-objects-for-properties