Created
June 2, 2021 14:27
-
-
Save ahhzaky/8be8a0e9d2ca464ad14e5399520f67e4 to your computer and use it in GitHub Desktop.
Quiz js map dicoding
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
/** | |
* TODO: | |
* 1. Buatlah variabel currency yang merupakan Map dengan kriteria: | |
* - key "USD", value 14000 | |
* - key "JPY", value 131 | |
* - key "SGD", value 11000 | |
* - key "MYR", value 3500 | |
* 2. Buatlah variabel priceInIDR yang bernilai dari hasil perkalian: | |
* - priceInJPY dengan nilai currency JPY | |
*/ | |
const priceInJPY = 5000; | |
// TODO | |
const currency = new Map([ | |
["USD", 14000], | |
["JPY", 131], | |
["SGD", 11000], | |
["MYR", 3500] | |
]); | |
const priceInIDR = currency.get("JPY") * priceInJPY | |
console.log(priceInIDR) |
terimakasih mas ... jadi tambah semangat belajar ...
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
tahnks bang