I have the following object called checkObj. I'm trying to use a for... in loop to see if the object contains the property foundNum. Since it does exist, the purpose of the program is to then reassign the value of "found" to 1 as shown below.
const checkObj = {
oddNum: 1,
evenNum: 2,
foundNum: 5,
randomNum: 18
};
let found = 0;
// ADD CODE HERE
for (foundNum in checkObj) {
if (object.key(checkObj).includes = foundNum ) {
let found = 1
}
}
However, I get the following error: Reference Error on line 11: foundNum is not defined. I'm not very familiar with for... in loops so not sure how to fix this bug.