// Create a function named 'containsBool'that accepts an
// array as a parameter.
// You can remove the comments and use the following array:
// myArray = ['Wednesday',23,false];
// Create a for / in loop inside the function that iterates
// through the items in the array.
// In the loop, check each array item for 'typeof' data.
// If the array contains Boolean data, return true.
// Likewise, if the array does not contain Boolean data, return false.
// Call the function and log the returned Boolean to the console.
Here is my code, I don't know where it doesn't work:
var myArray = ['Wednesday', 23, true];
function containsBool(checkBool) {
for (g in checkBool) {
if (typeof checkBool[g] === 'boolean') {
return true;
} else {
return false;
}
}
}
console.log(containsBool(myArray));