๐ฐarrow function
(ES6) a new form of function expression.
JS โฉ value โฉ function โฉ arrow function
โญ๏ธ ES6 (2015)๏ผa new form of function expression.
when the { ... }
are omitted, a return value is sent out without using return.
โญ๏ธ arrow function as methodโ๏ธ (โ๏ธuse with cautionโ๏ธ)
normally, you don't use arrow functions as methods, but if you have๏ผ
an object A that has a method returning a new object B,
object B has its own methods,
you don't want this in these methods to refer to B but refer to A instead,
then using arrow functions as methods is an option.
๐ see example๏ผ Sequence
don't have access to new.target keyword.
canโt be used as constructors. (canโt be called with new)
canโt use
yield
, within its body.
deplicate parameters Early Error rule (๐ง) is always applied to arrow function definition even if 'strict mode' (๐ง) is not defined explicitly.
Last updated
Was this helpful?