Defining Global Functions
Overview
Why Use Global Functions?
How to Define a Global Function
window.numberWithCommas = function(x) {
return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
};What does it do?
Where Can You Use Global Functions?
Best Practices
Last updated