Message from JavaScript discussions

May 2019

— Check this

Message permanent page


Unexpected token, expected "{" (1:43)

> 1 | classes.trim().split(/\s+/g).forEach(class => {
| ^
2 | el.classList.add(class)});

— Wat

— What kind of browser are you testing this with

— The latest version of chrome

— Hi I learn basic JavaScript and then
Learn some basic of node ka to work on

Can you please suggest me what to do after that to work in good js stack

Message permanent page

— There is a udemy course I purchased guys clear all the doubts very well

— Wrong reply :P

— Please give me the link.

— Does this make sense to anyone?
Please, explain
Because print is not supposed to see increase, set and decrease.
If number is changed in set, shouldn't it be seen only by set?
Besides, what is for loop doing there?.
How is print able to see for loop?
The topic is closure

Message permanent page

— No one online?

— It makes total sense.
A function saves its context. In this case, number is available only by these functions.
When you use manager it modifies global variables that store the functions.
All of the four functions share the same context.
For loop is calling increase each loop, having no curly braces is the same as having a single line block of code.

Message permanent page