Created
March 23, 2018 22:04
-
-
Save mgreich/ceb85e046ff9788b951bf58e7ebe53bb to your computer and use it in GitHub Desktop.
JS Bin // source https://jsbin.com/maduwe
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<script id="jsbin-javascript"> | |
const contracts = { | |
111: {name: "contract111"}, | |
222: {name: "contract222"}, | |
333: {name: "contract333"}, | |
444: {name: "contract444"}, | |
} | |
const contractIds = [111, 333] | |
const myContracts = contractIds.map(id => { | |
return contracts[id] | |
}) | |
console.log(myContracts) | |
</script> | |
<script id="jsbin-source-javascript" type="text/javascript">const contracts = { | |
111: {name: "contract111"}, | |
222: {name: "contract222"}, | |
333: {name: "contract333"}, | |
444: {name: "contract444"}, | |
} | |
const contractIds = [111, 333] | |
const myContracts = contractIds.map(id => { | |
return contracts[id] | |
}) | |
console.log(myContracts)</script></body> | |
</html> |
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
const contracts = { | |
111: {name: "contract111"}, | |
222: {name: "contract222"}, | |
333: {name: "contract333"}, | |
444: {name: "contract444"}, | |
} | |
const contractIds = [111, 333] | |
const myContracts = contractIds.map(id => { | |
return contracts[id] | |
}) | |
console.log(myContracts) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment