Created
April 27, 2018 02:08
-
-
Save adatta02/32ffc62f4ff999b13f561e3b379f275d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** Output some stuff **/ | |
console.log("Hello evil world!"); | |
/** A for loop **/ | |
let total = 0; | |
for(let i = 0; i < 10; i++){ | |
total += i; | |
} | |
console.log(total); | |
/** A while **/ | |
total = 0; | |
while(total <= 10){ | |
total += 1; | |
} | |
console.log(total); | |
/** Function callin **/ | |
function isEven(num){ | |
return num > 0 && num % 2 == 0; | |
} | |
console.log("173 is " + (isEven(173) ? " even " : "odd")); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment