Skip to content

Instantly share code, notes, and snippets.

View lucasdaiki's full-sized avatar
🇧🇷
SOY LOCO POR TI PARMERA

Lucas Daiki lucasdaiki

🇧🇷
SOY LOCO POR TI PARMERA
  • Remessa Online
  • São Paulo
View GitHub Profile
@lucasdaiki
lucasdaiki / ArrayExercise.js
Created June 21, 2017 17:10 — forked from SteveBate/ArrayExercise.js
Exercise testing the various Javascript Array methods but particularly the functional methods available
// set up arrays
var numbers = [1,12,4,18,9,7,11,3,101,5,6];
var strings = ['this','is','a','collection','of','words'];
// array.reduce - find largest number
var largestValue = numbers.reduce(function(x,y){ return x > y ? x : y });
console.log('largest number: ' + largestValue);
// array.reduce - find longest string
@lucasdaiki
lucasdaiki / ArrayExercise.js
Created June 21, 2017 17:10 — forked from SteveBate/ArrayExercise.js
Exercise testing the various Javascript Array methods but particularly the functional methods available
// set up arrays
var numbers = [1,12,4,18,9,7,11,3,101,5,6];
var strings = ['this','is','a','collection','of','words'];
// array.reduce - find largest number
var largestValue = numbers.reduce(function(x,y){ return x > y ? x : y });
console.log('largest number: ' + largestValue);
// array.reduce - find longest string