Ad
Code
Diff
  • const evenOrOdd = n => n%2===0 ? 'even' : 'odd';
    • const number = prompt("Enter a number: ");
    • if(number % 2 == 0){
    • console.log("The number is even.");
    • }else{
    • console.log("The number is odd.");
    • }
    • const evenOrOdd = n => n%2===0 ? 'even' : 'odd';

Function names should start with lower case.
const should be used instead of var since the function isn't changing.

Code
Diff
  • const greet = () => "Hello World!";
    • function Greet(){return "Hello World!"}
    • const greet = () => "Hello World!";