Within the constructor of a class, this
refers to the newly created object. Within a method, however, this
might refer to another value if the method is called as an ordinary function. Just like any other object method, class methods can lose their intended receiver this way.
This lesson shows different approaches to solving this problem either by binding class methods or by using class fields with arrow functions instead.
Freakin awesome!
Very nice explanation.
Hi, what is this babel | node? It's from node?
@Gisele: I'm using a Unix Pipeline to feed the output generated by npm run babel
directly into node
to execute the transpiled JavaScript code.
So it's some kind of comand-line? Like prompt (windows) or git bash?
@Gisele: |
is shell syntax that can be used on the command line, yes.
@Marius, great course, love how specific and concise this is! (pun intended)