Skip to content

Instantly share code, notes, and snippets.

@fredericksilva
Created June 18, 2015 13:57
Show Gist options
  • Save fredericksilva/8aa339cccb30ee1c7abb to your computer and use it in GitHub Desktop.
Save fredericksilva/8aa339cccb30ee1c7abb to your computer and use it in GitHub Desktop.
Asynchronous Programming
var stocks = [
{ symbol: "XFX", price: 240.22, volume: 23422 },
{ symbol: "TNZ", price: 332.19, volume: 234 },
{ symbol: "JXJ", price: 120.22, volume: 5323 }
];
var filteredStockSymbols =
stocks.
filter(function(stock) {
return stock.price >= 150.00;
}).
map(function(stock) {
return stock.symbol;
});
filteredStockSymbols.forEach(function(symbol) {
console.log(symbol);
});
@fredericksilva
Copy link
Author

  • Chaining the Array map and filter methods Arquivo 3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment