Lightning Components – Using Let and Const in Lightning Components

Is there any reason why I should not be using let instead of var when writing Lightning Components? I would much rather use let if possible but I dont want to run into any compatibility issues

Best Answer

For a while, cross-browser support meant that IE 11 was holding everyone back. There's currently no transpiler (though its been said to be in the works), so if you enabled Extended Internet Explorer 11 mode, be aware that your components may not work in IE 11 if you use let. If you don't support IE 11, then there's no reason to not use it.

Related Topic