JavaScript ES6 Tutorial #3 - The Let Keyword

preview_player
Показать описание
Yo ninjas, in this Ecmascript 6 tutorial, I'll be introducing you to the 'let' keyword. The let keword allows us to create a variable with lexical scope, which essentially means that the variable does not ignore code blocks. When we create a variable using the let keyqord within a code block, the variable is said to have lexical scope, and only applies WITHIN that code block.

----- COURSE LINKS:

---------------------------------------------------------------------------------------------
You can find more front-end development tutorials on CSS, HTML, JavaScript, jQuery, WordPress & more on the channel homepage...

========== JavaScript for Beginners Playlist ==========

============ CSS for Beginners Playlist =============

============== The Net Ninja =====================

================== Social Links ==================

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

content from 8 years ago, and this is still very easy to comprehend and useful! Thank you!

xyzrdry
Автор

Nice tutorials, And that ninja screams so loud.

alejov
Автор

Wasn't it supposed to log 'undefined' because the variable no longer exists after the for loop is over?

leocroft
Автор

I still dont understand how numbers are saved to th functions in the loop anyway please help!

HAIM
Автор

Hey, I didn't understood why the value persisted?
We didn't created any closer here, still the value of x when defined using `let` acts like we did clouser. How that works?

SanujBhatnagar
Автор

In lexical scope, how is x value, when logged to console, not overwritten each iteration loop?

mykevin
Автор

​ @The Net Ninja hi, i still dont understand how is it that when you use var to declare, the output when you click a list item is 4. I don't understand the process that leads to that output.

iquahs
Автор

Thank you for your work, but I still don't understand the difference between the var keyword and the let keyword In the loop. Why is it going such way?

prometheusmusic
Автор

What would happen to the number result in console if you clicked the numbers in the order of 3 2 1 0 instead of going up 0123?

philliprousu
Автор

How did you making your Brackets linter to stop showing linting warnings about Es6?

Noldy__
Автор

Excellent tutorial, but has no sense have at 04:37 "x" how global scope. It should be a local variable for the "for" block. Seems "let" is the workaround to resolve this explicitly

manueljordan
Автор

I don't suppose you can do a framework tutorial and how to upload to a server?

anatolenavarro
Автор

So how did js deal with this before the let keyword was introduced?

lardosian