Why I’m Excited for #javascript Class Private Fields: A Case Study
▻https://hackernoon.com/why-im-excited-for-javascript-class-private-fields-a-case-study-5748d30f
JavaScript Class Privacy — Or Lack ThereofClasses are nothing new in programming, but their implementation in JavaScript is, well, weird. For anyone used to classes in other languages, you might think of them as blueprints from which new instances are copied. Additionally, you might think that these classes would offer public, private, and protected instance properties. In JavaScript, neither of these is true: new instances of objects have a prototypal inheritance relationship with their parents and there is no such thing as private or protected properties. In this article, I am going to dive into the latter point a bit further.Note: If you enjoy this article, please give it a clap ? (or 50!) to help spread the word!Why Private Fields in a JavaScript Class?I started thinking about the issue (...)
#web-development #es6 #object-oriented #software-development