Last active
December 13, 2015 13:36
-
-
Save butchi/379999efd4928c64b6e1 to your computer and use it in GitHub Desktop.
ES2015時代のFizzBuzzに挑戦する ref: http://qiita.com/butchi_y/items/59d45e8212643b43cba4
This file contains 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
Array(100) |
This file contains 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
for(i=0;++i<101;console.log(i%5?x||i:x+'Buzz'))x=i%3?'':'Fizz' |
This file contains 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
Array(100).forEach(elm=>console.log(elm)) |
This file contains 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
Array(100).fill(0).forEach(elm=>console.log(elm)) |
This file contains 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
keys(this).forEach((_,i)=>console.log((++i%3?'':'Fizz')+(i%5?'':'Buzz')||i)) |
This file contains 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
var a = 5, b = 3, c = 8; | |
var obj = { | |
a: a, | |
b: b, | |
c: c | |
} |
This file contains 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
var a = 5, b = 3, c = 8; | |
var obj = { | |
a, | |
b, | |
c | |
} |
This file contains 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
console.log(`hoge${1}`); // => 'hoge1' |
This file contains 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
f='Fizz';b='Buzz';fb=f+b;for(i=0;++i<101;)console.log(eval('f '[i%3]+'b '[i%5])||i) |
This file contains 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
Array(100).fill(0).forEach((_,i)=>console.log((++i%3?'':'Fizz')+(i%5?'':'Buzz')||i)) |
This file contains 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
Array(100).fill(i=0).forEach(_=>console.log((++i%3?'':'Fizz')+(i%5?'':'Buzz')||i)) |
This file contains 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
for(i=0;++i<101;console.log(i%5?x||i:x+'Buzz'))x=i%3?'':'Fizz' |
This file contains 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
for(i=0;++i<101;)console.log((['Fizz'][i%3]||'')+(['Buzz'][i%5]||'')||i) |
This file contains 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
o={0:'Fizz',Infinity:'Buzz',NaN:'FizzBuzz'};for(i=0;i<100;)console.log(o[(++i%3)/(i%5)]||i) |
This file contains 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='Fizz';_2='Buzz';_3=_1+_2;for(i=0;++i<101;)console.log({_1,_2,_3}[`_${!(i%3)+!(i%5)*2}`]||i) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment