This week in front end architecture

In a react/redux application:

  • add a checkbox
    in jsx

  • capture its state by setting its vDom state with { [name]: !this.state.checked }
    in a switch statement

  • unit tests are jest snapshot diffs
    in typescript

  • className="bootstrap" or className={style.injection}
    incompatible

Making simple things hard in the front end again.

Number().toFixed() rounding errors: broken but fixable

Original gist for this post

I found a rounding bug in Number().toFixed() in every JavaScript environment I’ve tried (Chrome, Firefox, Internet Explorer, Brave, and Node.js). The fix is surprisingly simple. Read on…

Continue reading “Number().toFixed() rounding errors: broken but fixable”