jspro.com jspro.com

A Beginner’s Guide to Babel

This article introduces Babel, a JavaScript compiler that allows developers to use next-generation JavaScript today. It can be frustrating to write JavaScript when building web applications. We have to think about the features available in the browsers we’re targeting and what happens when a feature isn’t implemented. Some people would recommend simply not using it, which is a painful experience most of the time if we’re building...

jspro.com jspro.com

JavaScript’s New Private Class Fields, and How to Use Them

ES6 introduced classes to JavaScript, but they’re too simplistic for complex applications. Class fields (also referred to as class properties) aim to deliver simpler constructors with private and static members. The proposal is currently at TC39 stage 3: candidate and could appear in ES2019 (ES10). A quick recap of ES6 classes is useful before we examine class fields in more detail. ES6 Class Basics JavaScript’s prototypal...