Skip to content

Instantly share code, notes, and snippets.

Avatar

Raphael rebelnz

  • Enkoder
  • Melbourne Australia
View GitHub Profile
View log.js
console.log("I believe I can be a valuable asset to your company!");
View mapped.js
const officers = [
{id: 1, name: 'Cpt Brown', country: 'NZ'},
{id: 2, name: 'Lt Fredrick', country: 'USA'},
{id: 3, name: 'Sgt Deaken', country: 'NZ'},
{id: 4, name: 'Lt Smoller', country: 'CAN'},
{id: 5, name: 'Cpt Kincaid', country: 'USA'}
]
// var ids = officers.map(function(o) {
// return o.id
@rebelnz
rebelnz / functional.js
Created Feb 19, 2019
filter, map, reduce javascript
View functional.js
var pets = [
{name:"rover",animal:"dog",amount:27},
{name:"freddy",animal:"turtle",amount:27},
{name:"deefor",animal:"dog",amount:27},
{name:"sir barkalot",animal:"dog",amount:27},
{name:"cedric",animal:"snake",amount:27}
]
// var dogs = pets.filter(function(pets) {
// return pets.animal == "dog"