Hello, the differences 'var' and 'let' know)

I went into the specification, it is written in red 'Draft'. Screenshot Immediately I thought that you need to throw out the var and use only let. And wherever he could have replaced.

but when I went to let - I saw the same thing .. Screenshot . Please tell me where it is reliable, what to throw out, and what to leave?

PS Support for old browsers is not needed. let no difficulties. Thank you very much

  • Let many more do not support, I use only in node.js, for now. - user190134
  • 2
    Um, and nothing, that var on your screenshot is still in the three specifications with the status of Standard ? - D-side

1 answer 1

This is the norm! At the moment, the specifications of 2015 on let and var are accepted standards, and similar specifications of 2017 are still being developed and are in the state of draft (draft).

Thus, you can use the functionality described in the specifications of 2015, but for now you cannot use what appears only in 2017 (probably in this list there are let expressions and let blocks)

  • I can add: everything is possible if you have a babel :) - Pavel Mayorov
  • @PavelMayorov feel free to add directly to the answer) - Nick Volynkin
  • Yes, there is no need to add, and correct. Because, in fact, the fact of adopting a standard is not so important - as a list of supporting browsers. - Pavel Mayorov
  • @PavelMayorov shared. If you can fix it, I will be glad. - Nick Volynkin
  • funny, in the pictures, the seventh edition is missed, which has already been released - Grundy