JavaScript ES6 / ES2015 - [09] Arrow Functions

preview_player
Показать описание
In this video we will be looking at arrow functions in the ES6 / ES2015 syntax

SUPPORT THIS CHANNEL WITH A CUP OF COFFEE PER MONTH:

ONE TIME DONATIONS:
Рекомендации по теме
Комментарии
Автор

I think you could have picked a more beginner friendly code example to explain arrow functions.

sib
Автор

Typing out the code and explaining what you're doing is really good.
There is a lot more to es6's arrow function than saving a few key strokes which you gloss over very quickly.
This tutorial could be 100x better if you spent even 5-6 min explaining the WHY in addition to giving the example.

The previous tutorial in this series (SET, WEAKSET, WEAKMAP) has the same issue. Good example, not enough theory.

generalco
Автор

man when i look for a video on Youtube and i get Traversy Media version of this video, im happy

tranger
Автор


    return arr.map((x) => {

    })
};
This is lexical scoping as every new function defines its own this value. An arrow function does not define its own this but inherits from the enclosing scope

helengu
Автор

Lexical scoping (sometimes known as static scoping ) is a convention used with many programming languages that sets the scope (range of functionality) of a variable so that it may only be called (referenced) from within the block of code in which it is defined. The scope is determined when the code is compiled. A variable declared in this fashion is sometimes called a private variable.

PBUK
Автор

This is the best video on the arrow function, still don't understand a thing but it's the best, lol

tylerrobinson
Автор

"this" inside a nested function refers to a global object. In our case, callback inside arr.map is a nested function. "this" inside an arrow function refers to a closest "object-wrapper", in our case it is a pre

sergeyphilippenko
Автор

I believe that this topic needs more explanation as well as examples as it is confusing to many individuals. I do hope you will post many more examples.

iceman
Автор

Another useful staff with arrow functions:

let sum=(a, b)=>a+b;
sum(1, 4); //return 5

cebenbb
Автор

What the fuck is this?! I just wanted to know about the arrows LOL

cookiecutter
Автор

New to JS, this video finally put some concepts together!

hunteroffire
Автор

Great ex. Coming from a Python background, this was a little confusing. However this explained it very nicely. Thanks!

Colstonewall
Автор

Thank you so much for these tutorials! they're really great!

bsmanor
Автор

my vscode doesn't recognise => signs

motiondesigner
Автор

Great explanation! But what do you mean by a "lexical this"?

rampage
Автор

"pretty easy example of the syntax"

seanlangley
Автор

so do we not need to declare instance fields ?

JD-vkpm
Автор

I have a question. You might know already that Class Syntax of JS is a syntactic sugar for prototypical pattern. Then does it mean that structure of Class Syntax is built by the arrow functions for being able to pass every `this` variables, not anonymous functions?

juanyang
Автор

are you using babel for compilation ? if yes then after page reload how the es6 compiling ?

shadabzilani
Автор

What exactly does he mean 'lexical this'?

TT-udgf