Skip to content

Instantly share code, notes, and snippets.

@luislobo14rap
Last active December 16, 2023 08:58
Show Gist options
  • Select an option

  • Save luislobo14rap/cffe6c8347679304bba888b77590ad1b to your computer and use it in GitHub Desktop.

Select an option

Save luislobo14rap/cffe6c8347679304bba888b77590ad1b to your computer and use it in GitHub Desktop.
odd-or-even.js
// odd-or-even.js v1
function oddOrEven(number_){ // 0 = even, 1 = odd
return number_ % 2 === 0 ? 0 : 1;
};
// is-odd.js v1
function isOdd(number_){
return number_ % 2 !== 0;
};
// is-even.js v1
function isEven(number_){
return number_ % 2 === 0;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment