Ive seen these two paragraphs of code on YDKJS up and going.
If I understand them wrongly ,please tell me.
1st:
function foo() {
"use strict";
// this code is strict mode
function bar() {
// this code is strict mode
}
}
// this code is not strict mode
In the code above, everything under function foo()
is under strict mode.
2nd:
"use strict";
function foo() {
// this code is strict mode
function bar() {
// this code is strict mode
}
}
// this code is strict mode
In the code above, everything is in strict mode.
Am I right about this???