Skip to content

Instantly share code, notes, and snippets.

View juliaheller's full-sized avatar
🐜
learning, working, learning, working...

Julia Jimenez Blasco juliaheller

🐜
learning, working, learning, working...
  • Berlin
  • 07:13 (UTC -12:00)
View GitHub Profile
@juliaheller
juliaheller / !Mocha
Created January 31, 2020 08:20 — forked from joma74/!Mocha
Install mocha locally
All about mocha
// Node.js CheatSheet.
// Download the Node.js source code or a pre-built installer for your platform, and start developing today.
// Download: http://nodejs.org/download/
// More: http://nodejs.org/api/all.html
// 0. Synopsis.
// http://nodejs.org/api/synopsis.html
@juliaheller
juliaheller / gist:73b4662a85d7c7793382c45c8655b86e
Created January 28, 2020 09:03 — forked from TessMyers/gist:a252520dd9a8fe68f8e5
Simple exercises using .map and .reduce
// Simple problems to solve using the native .reduce and .map array methods. Each of these problems can be solved in many
// different ways, but try to solve them using the requested higher order function.
// MAP
// Write a function capitalize that takes a string and uses .map to return the same string in all caps.
// ex. capitalize('whoop') // => 'WHOOP'
// ex. capitalize('oh hey gurl') // => "OH HEY GURL"
var capitalize = function(string){
// code code code!
@juliaheller
juliaheller / reduceExamples.js
Created January 27, 2020 16:46 — forked from quangnd/reduceExamples.js
Some examples about reduce() in Javascript
//Example 1 - Calculate average value of an array (transform array into a single number)
var scores = [89, 76, 47, 95]
var initialValue = 0
var reducer = function (accumulator, item) {
return accumulator + item
}
var total = scores.reduce(reducer, initialValue)
var average = total / scores.length
/*Explain about function