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
const calcs = {}; | |
const sum = (a,b) => { | |
let key = 'sum' + (a+b).toString(); | |
if ( key in calcs ) | |
return 'found: ' + calcs[key] | |
let total = a + b; |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
<style id="jsbin-css"> | |
:root { | |
--circle: 5px; | |
--background: #fff; |
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
function fizzBuzz (num) { | |
for (i = 1; i <= num; i++) { | |
let fizz = i % 3 === 0, | |
buzz = i % 5 === 0; | |
console.log(fizz && buzz ? 'fizzBuzz' : fizz ? 'Fizz' : buzz ? 'Buzz' : i); | |
} // end for loop | |
} | |
fizzBuzz(20); |