Skip to content

Instantly share code, notes, and snippets.

@valerymelou
Created May 20, 2018 10:43
Show Gist options
  • Save valerymelou/b27413da45e8ca1c99420193b070f1aa to your computer and use it in GitHub Desktop.
Save valerymelou/b27413da45e8ca1c99420193b070f1aa to your computer and use it in GitHub Desktop.
Array.prototype.decimalfy = function() {
for (i = 0; i < this.length; i++) {
this[i] = this[i].toFixed(2);
}
};
const digits = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
for (const digit of digits) {
console.log(digit);
}
/**
0
1
2
3
4
5
6
7
8
9
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment