Created
October 23, 2015 07:02
-
-
Save lukluk/58796ddfa9c2fc27b912 to your computer and use it in GitHub Desktop.
Javascript quiz
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
#1. JS FRONTEND | |
STORY : saya punya koleksi url dari sebuah API, saya mau mendapat semua hasil dari setiap url yang di pangil secara PARALEL | |
atau bersamaan | |
CATATAN : kita tidak ingin mengunakan modul/lib apa pun, semuanya native js | |
TODO : buatlah function 'getAnyMember' yang akan memberikan callback berserta resultnya | |
EXAMPLE RESPONSE EACH URL : | |
{id:1,name:'jhon'} | |
CLUE : | |
var url=['http://api.example.com/gold/id/1','http://api.example.com/silver/id/2','http://api.example.com/silver/id/3','http://api.example.com/black/id/4'] | |
var resultAll=[] | |
getAnyMember(url,function(result){ | |
resultAll=result | |
}) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment