"use strict";
false.true = ""; // TypeError
(14).sailing = "home"; // TypeError
"with".you = "far away"; // TypeError
// Assignment to a non-writable global
undefined = 5; // TypeError
Infinity = 5; // TypeError
delete Object.prototype; // TypeError
delete [].length; // TypeError
function myStrictFunction() {
// Function-level strict mode syntax
"use strict";
function nested() {
return "And so am I!";
}
return `Hi! I'm a strict mode function! ${nested()}`;
}