Add "use strict" at the top of your script to enable strict mode:
"use strict"
let x = 10
Strict mode catches common mistakes that would otherwise fail silently. For example, assigning to an undeclared variable throws an error instead of creating a global variable. This helps you find bugs early. Always use strict mode in new code.