April 2018
Beginner to intermediate
426 pages
10h 19m
English
Some developers prefer using the underscore naming convention to mark an attribute as private in JavaScript:
class Stack { constructor() { this._count = 0; this._items = {}; }}
It consists of prefixing an underscore (_) before the name of the attribute. But this option is just a convention; it does not protect the data and we depend on the common sense of the developer who will use our code.