Skip to content

Instantly share code, notes, and snippets.

@matmar10
Created February 12, 2019 11:45
Show Gist options
  • Save matmar10/7bcadd240b402d891ec2d14bf2f59a8f to your computer and use it in GitHub Desktop.
Save matmar10/7bcadd240b402d891ec2d14bf2f59a8f to your computer and use it in GitHub Desktop.
JS Bin // source https://jsbin.com/wabojos
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<script src="https://code.jquery.com/jquery-3.1.0.js"></script>
<link href="https://code.jquery.com/qunit/qunit-git.css" rel="stylesheet" type="text/css" />
<script src="https://code.jquery.com/qunit/qunit-git.js"></script>
<script src="https://blossom-sample-api.herokuapp.com/qunit-test-suite.js"></script>
</head>
<body>
<div id="qunit"></div>
<script id="jsbin-javascript">
/**
* Implement a function called getUsers which:
*
* - Accepts an Array which is a list of user IDs
*
* - Fetches each user by ID from the provided REST API documented at:
* https://blossom-sample-api.herokuapp.com
*
* - Returns a Promise that is resolved with an Array of user Objects
*
* - Produces a resulting array in the same order as requested
* (for example, if [1, 4, 2] is input, user objects will correspond to users # 1, 4, 2 in the result)
*
*/
/**
* Looks up the list of IDs via the REST API
* and returns a promise which resolves with
* the list of users in the same order as requested
*
* @param {array} userIds Array of IDs in desired order
* @param {Promise<Array<Object>} Resolves with an array of user objects
*/
function getUsers(userIds) {
}
</script>
<script id="jsbin-source-javascript" type="text/javascript">
/**
* Implement a function called getUsers which:
*
* - Accepts an Array which is a list of user IDs
*
* - Fetches each user by ID from the provided REST API documented at:
* https://blossom-sample-api.herokuapp.com
*
* - Returns a Promise that is resolved with an Array of user Objects
*
* - Produces a resulting array in the same order as requested
* (for example, if [1, 4, 2] is input, user objects will correspond to users # 1, 4, 2 in the result)
*
*/
/**
* Looks up the list of IDs via the REST API
* and returns a promise which resolves with
* the list of users in the same order as requested
*
* @param {array} userIds Array of IDs in desired order
* @param {Promise<Array<Object>} Resolves with an array of user objects
*/
function getUsers(userIds) {
}
</script></body>
</html>
/**
* Implement a function called getUsers which:
*
* - Accepts an Array which is a list of user IDs
*
* - Fetches each user by ID from the provided REST API documented at:
* https://blossom-sample-api.herokuapp.com
*
* - Returns a Promise that is resolved with an Array of user Objects
*
* - Produces a resulting array in the same order as requested
* (for example, if [1, 4, 2] is input, user objects will correspond to users # 1, 4, 2 in the result)
*
*/
/**
* Looks up the list of IDs via the REST API
* and returns a promise which resolves with
* the list of users in the same order as requested
*
* @param {array} userIds Array of IDs in desired order
* @param {Promise<Array<Object>} Resolves with an array of user objects
*/
function getUsers(userIds) {
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment