We are required to write a JavaScript function that takes in an array of elements.
Our function should check whether or not the array contains an integer value.
We should return true if it does false otherwise.
Example
The code for this will be −
const arr = ["123", "", "21345", "90"]; const findInteger = (arr = []) => { const isInteger = num => { return typeof num === 'number'; }; const el = arr.find(isInteger); return !!el; }; console.log(findInteger(arr));
Output
And the output in the console will be −
false