Created
May 1, 2019 17:14
-
-
Save jlittlejohn/6d90e7616f5ca2cf4a601884692b15aa to your computer and use it in GitHub Desktop.
JS: Array Map Method Example
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
var forecast = [ | |
{ day: "Monday", sun: true, humidity: 10 }, | |
{ day: "Tuesday", sun: false, humidity: 100 }, | |
{ day: "Wednesday", sun: false, humidity: 100 }, | |
{ day: "Thursday", sun: true, humidity: 25 }, | |
{ day: "Friday", sun: false, humidity: 100 }, | |
{ day: "Saturday", sun: true, humidity: 15 }, | |
{ day: "Sunday", sun: false, humidity: 100 } | |
]; | |
var humidity = forecast.map(function(day) { | |
return day.humidity; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment