At times, let
doesn't allow the named function hoisting pattern. It does in Chrome 51, but does not in Safari 9.1.1. Thus,
let foo = func;
function func () {
return true;
}
would throw an error. Whereas the following style is valid:
var foo = func;
function func () {
return true;
}
Depending on your purposes, this could make your code more or less readable. For example, an exposing module pattern which has a lot of initialization code, so doesn't return immediately.
var foo = (function () {
let factory = {
func: func
};
init();
// do more init stuff
return factory;
function func () {
//
}
}());
Using function declarations to hide implementation details, for example.