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 numbers = [1,2,3,4,5]; | |
const sum = numbers.reduce( | |
(accumulator, currentValue) => accumulator + currentValue | |
); | |
console.log(sum); // 15 |
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 total = 0; | |
for (let index = 0; index < shoppingCart.length; index++) { | |
let currentItem = shoppingCart[index]; | |
total = total + currentItem.price * currentItem.quantity; | |
} |
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 shoppingCart = [ | |
{ | |
name: 'Diet Coke', | |
price: 1.50, | |
quantity: 3, | |
}, | |
{ | |
name: 'Dasani', | |
price: 1, | |
quantity: 2, |
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() { | |
const stats = { | |
wins: 0, | |
losses: 0, | |
}; | |
const times = x => f => { | |
if (x > 0) { | |
f() |
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
{ | |
"info": { | |
"name": "Adam Giese", | |
"summary": "With seven years of Web Developer experience, I have been focusing on front-end and WordPress development for the last three years." | |
}, | |
"experience": [ | |
{ | |
"employer": "Intelechy Group", | |
"title": "Senior Web Developer", | |
"from": "October 2014", |
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
{ | |
"hello": "world", | |
"hola": "mundo", | |
"howdy": "texas" | |
} |
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
@mixin valid-quantity($quantity) { | |
@if type-of($quantity) != 'number' { | |
@error 'The "quantity" parameter must be a number!'; | |
} | |
@if not(unitless($quantity)) { | |
@error 'The "quantity" parameter must not have a unit!'; | |
} | |
@if $quantity < 0 { | |
@error 'The "quantity" parameter must be at least 0!'; | |
} |
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, initial-scale=1, maximum-scale=1, user-scalable=no"> | |
<title>FizzBuzz</title> | |
</head> | |
<body> | |
<div id="Fizzy-Buzz"> | |
</div> |
NewerOlder