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
/* | |
* Lazy Line Painter | |
* SVG Stroke animation. | |
* | |
* https://github.com/camoconnell/lazy-line-painter | |
* http://www.camoconnell.com | |
* | |
* Copyright © 2013-2015 Cam O'Connell | |
* All rights reserved. | |
* |
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
for(var i = 1; i < 30; i++){ | |
console.log((i % 3 ? x = '' : 'Fizz')+(i % 5 ? x: 'Buzz') || x+i); | |
} |
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
for(var i = 1; i < 30; i++){ | |
if(i % 15 == 0){ | |
console.log("FizzBuzz"); | |
} | |
else if(i % 3 == 0){ | |
console.log("Fizz"); | |
} | |
else if(i % 5 == 0){ | |
console.log("Buzz"); | |
} |
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
for(var i = 1; i < 30; i++){ | |
console.log(i % 15 == 0 ? "FizzBuzz" : i % 3 == 0 ? "Fizz" : i % 5 == 0 ? "Buzz" : i); | |
} |
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
function getData(text){ | |
var commandAndArgs = text.split(" "); | |
var command = commandAndArgs[0]; | |
var args = commandAndArgs[1]; | |
var arrayOfArgs = args.split("_"); | |
var arg1 = arrayOfArgs[0]; | |
var arg2 = arrayOfArgs[1]; | |
if(command == "calc"){ | |
return arg1 - arg2; | |
} |
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
function getData(text){ | |
if(text.split(" ")[0] == "calc"){ | |
return text.split(" ")[1].split("_")[0] - text.split(" ")[1].split("_")[1]; | |
} | |
else{ | |
return false; | |
} | |
} | |
if(getData("calc 2_1")){ |
NewerOlder