JavaScript Class Privates

One of my aspects of JavaScript that drew me to it as a young developers was that its syntax was loose and I could code quickly. As you gain experience as an engineer, you start to realize that some traditional coding structure is a good thing, even if it slows you down. Using Jest or TypeScript to add typing to your JavaScript can save you from maintenance headaches and unexpected errors, for example. While those are pre-compile tools to accomplish structure, we’ve traditionally employed vanilla JavaScript patterns to mock private variables and methods in JavaScript. Did you know, however, that browsers and the JavaScript language support a specific syntax for creating private variables... more →
Posted in: JavaScript