Is there still reason to use var in JavaScript? [duplicate]

3

ES6 introduced the keywords let and const for declaration of variables.

Is there still reason to use var ? If yes, what scenarios to use?

    
asked by anonymous 08.09.2017 / 02:08

1 answer

1

Well, by doing a brief search on the internet, including SOen, there is no stated advantage. Until then, let and const offer some 'protection by following rules' more than var , but they do the same job.

To say no advantage, some browsers still do not accept the declaration of let and const , but otherwise, var can already be retired.

    
08.09.2017 / 05:11