function findvalue(arr,num){
const arr1 = arr.find((el) => el === num)
const arr2 = arr1? true: "Not found";
//console.log(arr2)
return arr2
}
console.log(findvalue([false, "7", null],7)
The function suppose to return true if the num would be found among one of the elements of array, otherwise return the string “Not found”
New contributor
KevinBacker is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
2