Created
January 10, 2017 20:32
-
-
Save mannuelf/6ff97a9d0e93ccbbcc8196de5e1546ef to your computer and use it in GitHub Desktop.
In Progress Network Requests: Given an array of network objects representing network requests, assign the boolean 'true' to the variable 'inProgress' if any network request has a 'status' of 'pending'.
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 requests = [ | |
{ url: '/photos', status: 'complete' }, | |
{ url: '/albums', status: 'pending' }, | |
{ url: '/users', status: 'failed' } | |
]; | |
var inProgress = requests.some(function(status) { | |
return status != 'pending'; | |
}); | |
console.log('value', inProgress); | |
// https://www.udemy.com/javascript-es6-tutorial/learn/v4/t/quiz/263440 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment