Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function country() {
- return '{"RU": 15, "US": 29, "CH": 67}';
- }
- function countryI (amount, from, to) {
- if (country) {
- try {
- let a = JSON.parse(country());
- return amount * a[from] * a[to];
- } catch(err) {
- console.log(err.name, err.message);
- }
- }
- }
- console.log(countryI(79, 'RU', 'US'))
Add Comment
Please, Sign In to add comment