What is the difference between const, let, var?

I don’t know where I want to use const , let, var

ES6 introduces const and let that are block scoped, while var is function scoped. Use const for non reassignable variables, else use let, no real needs for var anymore when using Ember (and ES6).

also see: let - JavaScript | MDN

In Ember itself, and in all of my personal projects I use the Liberal let strategy as discussed in: Let It Be - How to declare JavaScript variables :: madhatted.com.

1 Like

Is there an eslint plugin somewhere with liberal-let already written? (With autofixes?)

1 Like

I think this one is what I’ve used before: GitHub - cowboyd/eslint-plugin-prefer-let: Prefer using `let` when binding names to values. It has an auto fix (on master), but not sure if that has been released to npm.

1 Like