const isOdd = (number) => {
return number % 2 === 1
};
isOdd(29);
const atLeastTwo = (array, callback) =>
array.filter(callback).length >= 2
console.log(atLeastTwo([1, 2, 3, 4, 5], isOdd));
console.log(atLeastTwo([2, 4, 6], isOdd));
console.log(atLeastTwo([1, 2, 3, 4, 5], t => t > 3));
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter