Created
November 17, 2018 05:04
-
-
Save youngjinmo/284af07448fe2bf5a42feb3571b6f302 to your computer and use it in GitHub Desktop.
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
var bills = [50.23, 19.12, 34.01, | |
100.11, 12.15, 9.90, 29.11, 12.99, | |
10.00, 99.22, 102.20, 100.10, 6.77, 2.22 | |
]; | |
var totals = bills.map(function(element) { | |
element *= 1.15; | |
element = element.toFixed(2); | |
return Number(element); | |
}); | |
console.log(totals); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
tip
If you want convert string to number, use Number() method.