Created
June 18, 2015 13:57
-
-
Save fredericksilva/8aa339cccb30ee1c7abb to your computer and use it in GitHub Desktop.
Asynchronous Programming
This file contains hidden or 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
| 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); | |
| }); |
Author
fredericksilva
commented
Jun 18, 2015
- 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