Intl.NumberFormat
Currency formatting is in the browser, has been for years, and is still being done with a hardcoded dollar sign and a call to toFixed in most of the code I read.
11 posts filed under JavaScript, newest first.
Currency formatting is in the browser, has been for years, and is still being done with a hardcoded dollar sign and a call to toFixed in most of the code I read.
The thing everybody knows as the way to cancel a fetch is also the tidiest way to remove a pile of event listeners, and the second use has changed more of my code than the first.
A designer sent over a few seconds of the client's own phone app, where a tapped product photo grows into the hero image on the next screen, with a note asking whether the website could do that.
A client asked what progressive enhancement meant in practice and the 4 of us in the room produced about 90 seconds of gesturing, not one word of which anybody could have written down.
A category page came back from the back button with nothing on it, and every card was already in the DOM at opacity 0, waiting on a scroll event that had come and gone before my script was listening.
I applied a filter on a client's product listing with the keyboard and the next Tab put me on the site logo, which is the browser doing exactly what it's supposed to do with a focused element that stopped existing.
I rewrote a staff directory with hooks the week they landed, and the search box started returning the results for whatever I'd typed a keystroke earlier.
A client's nav collapsed at the wrong width on my machine and nobody else's, and it took two days to find out that the four of us had four different copies of the same dependencies.
A page on two bars doesn't fail, it just sits there, and that turned out to be the only state where the thing I spent an evening building does anybody any good.
ES6 is arriving all at once through a transpiler, which means that adopting it is a series of individual choices instead of one and some of those features have earned it more than others.
Most of what jQuery was invented to fix has been fixed in the browsers, and a lot of us are still loading the whole library to avoid typing a slightly longer method name.