Skip to content

Instantly share code, notes, and snippets.

@ahhzaky
Created June 2, 2021 14:27
Show Gist options
  • Save ahhzaky/8be8a0e9d2ca464ad14e5399520f67e4 to your computer and use it in GitHub Desktop.
Save ahhzaky/8be8a0e9d2ca464ad14e5399520f67e4 to your computer and use it in GitHub Desktop.
Quiz js map dicoding
/**
* 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)
@yovanfajar
Copy link

tahnks bang

@fariedrahmat
Copy link

terimakasih mas ... jadi tambah semangat belajar ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment