Skip to content

Instantly share code, notes, and snippets.

View rebelnz's full-sized avatar

Raphael rebelnz

  • Enkoder
  • Melbourne Australia
View GitHub Profile
console.log("I believe I can be a valuable asset to your company!");
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 February 19, 2019 04:41
filter, map, reduce javascript
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"