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
// // FIRST WAY | |
// // using a simple for loop | |
// function getStockSymbols(stocks) { | |
// var results = [], | |
// counter, | |
// stock; | |
// | |
// for (counter = 0; counter < stocks.length; counter++) { | |
// stock = stocks[counter]; | |
// results.push(stock.symbol); |
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
// create an object using reduce function on array with count of each item | |
var votes = [ | |
'angular', | |
'angular', | |
'react', | |
'react', | |
'react', | |
'angular', | |
'ember', | |
'vanilla', |