Last active
September 3, 2015 21:21
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
//1. FizzBuzz | |
function fizzBuzz(number) { | |
var buzz = number % 5 === 0, fizz = number % 3 === 0; | |
if (fizz && buzz) return "fizzbuzz"; | |
else if (buzz) return "buzz"; | |
else if (fizz) return "fizz"; | |
else return String(number); | |
}; | |
//2. onClickList | |
var ul = document.getElementsByTagName('ul')[0]; | |
function onClickList() { | |
if (list.innerText) return list.innerText; | |
else if (list.textContent) return list.textContent; | |
} | |
list.addEventListener('click', onClickList); | |
//3. adder | |
function adder(n) { | |
function fn(i) { return(n + i); } | |
return fn; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment