Skip to content

Instantly share code, notes, and snippets.

@heryvandoro
Created October 2, 2018 08:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save heryvandoro/6d9264c60873f9494a45eefd2d9190d5 to your computer and use it in GitHub Desktop.
Save heryvandoro/6d9264c60873f9494a45eefd2d9190d5 to your computer and use it in GitHub Desktop.
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