Uncaught SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode [duplicate]
Solution 1:
This means that you must declare strict mode by writing "use strict"
at the beginning of the file or the function to use block-scope declarations.
EX:
function test(){
"use strict";
let a = 1;
}