I saw a tutorial for JavaScript ES6 in which the guy used this syntax to assign a value with let
:
let = name = ['Jhon','Paul','Ean']
What is the difference between the first and this:
let name = ['Jhon','Paul','Ean']
Usage Let is followed by a verb that has the form of the infinitive without to. Let is never used as be let; use be allowed or be permitted instead. Let me do that for you.
The difference between let's and letsLet's is a contraction of “let us.” You use it to make suggestions about what you and someone else should do. Let's go to the movies. Let's invite Mom. Lets is the third-person singular present tense form of verb let, which means to allow or give permission.
The first one is creating two global variables: let
and name
, and
assigning the array first to name
and then to let
. It is not what
you want for sure.
The second one creates a block scope local variable called name
. This
is the one you want!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With