Skip to content

Instantly share code, notes, and snippets.

@adatta02
Created April 27, 2018 02:08
Show Gist options
  • Save adatta02/32ffc62f4ff999b13f561e3b379f275d to your computer and use it in GitHub Desktop.
Save adatta02/32ffc62f4ff999b13f561e3b379f275d to your computer and use it in GitHub Desktop.
/** 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