Created
October 2, 2018 08:26
-
-
Save heryvandoro/6d9264c60873f9494a45eefd2d9190d5 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
let decimals = [10.2, 11.5, 12.3]; | |
let roundedDecimals = decimals.map(decimal => { | |
return Math.round(decimal); | |
}); | |
console.log(roundedDecimals); | |
/* Output : | |
[10, 12, 12] | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment