After IE was "retired", the default features of JavaScript are "almost" enough for make relatively complex and safe programs. On the other side, TypeScript provide full spectrum features comparable to compiled programming languages. Well worth of a bit added setup complexity and transpiling time.
Private class features - JavaScript | MDN
Working with private class features - JavaScript | MDN
class Counter extends HTMLElement {
#xValue = 0;
get #x() { return #xValue; }
set #x(value) {
this.#xValue = value;
window.requestAnimationFrame(this.#render.bind(this));
}...
Private Methods and Properties in TypeScript Classes
TypeScript: Documentation - Classes
TypeScript: Documentation - Classes (member visibility)
classA {privatex = 10; protected y: number = 5;z = 'abc'; // default visibility is "public"
No comments:
Post a Comment