Please enable JavaScript.
Coggle requires JavaScript to display documents.
ES6-CLASSES - Coggle Diagram
ES6-CLASSES
BASICS
Syntactic
Sugar
Over
Prototypical
Inheritance
Are-Functions
Create
class Circle { }
Constructor
constructor() { }
Methods
Prototype
class Circle { method() {} }
Own
constructor() {...}
this.method = func() {}
Static
class Circle { static parse() {} }
Not-Available
In-Instances
AS
Prototype-methods
Own-methods
PRIVATE
Members
Symbol
Symbol() === Symbol()
Always
False
const _radius
= Symbol()
Inside
Constructor
this[_radius]
= radiusArg
Method
[_draw]() {..}
Computed-Prprty
WeakMap
What
Keys
Are-Objects
Values
Can-Anything
Is-Dictionary
Keys
Un-referenced
Garbage
Collected
Using
const _radius
= new WeakMap()
Inside
Constructor
_radius.set(this, radiusArg)
Getting
val = _radius.get(this)
Method
Inside-Constr
_move.set(this, func)
GETTERS/SETTERS
Getter
get radius() {...}
Inside
Method-Prefix
Class
Setter
set radius(val) {...}
INHERITANCE
class
Child extends
Parent
constructor(val) {...}
super(val)
HOISTING
Declaration
class Circle {}
Not-Hoisted
Expression
const Circle = class {}
THIS
Method-Call
obj.draw()
Funcation-Call
const mDraw =
obj.draw
mDraw()
This
gives
Window-Obj
Strict-Mode
Undefined
Inside-Class
Always
Undefined
OVERRIDING
Redeclare
Method
In-Child
Using
Parent-Method
super.move()