Skip to content

Instantly share code, notes, and snippets.

@TheShubhamVsnv
Created May 12, 2024 16:57
Show Gist options
  • Save TheShubhamVsnv/beb658b1e8c0411ec8dda97df2dc1526 to your computer and use it in GitHub Desktop.
Save TheShubhamVsnv/beb658b1e8c0411ec8dda97df2dc1526 to your computer and use it in GitHub Desktop.
let numbers = [2, 4, 6, 8];
let allEven = numbers.every(num => num % 2 === 0); // Check if all numbers are even
let hasOdd = numbers.some(num => num % 2 !== 0); // Check if any number is odd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment