DEV Community

Discussion on: JavaScript Scopes

Collapse
 
damcosset profile image
Damien Cosset

Did you find any use cases where var is actually a good idea? Or is this keyword totally useless now that let and const have been added?

Collapse
 
kayis profile image
K

just compat reasons. If you want make something that runs in all browsers without compilation, you would go for var.

But I guess this is just a thing for tiny libs.