Trong strict mode, this ở hàm thông thường là undefined thay vì global object (window/global).
Điều này giúp phát hiện lỗi khi vô tình gọi hàm như function thay vì method.
javascript
function foo() { console.log(this); }
foo(); // non-strict: Window (browser)
'use strict';
function bar() { console.log(this); }
bar(); // strict: undefinedKích hoạt bằng 'use strict'; ở đầu file hoặc hàm.
ES modules tự động bật strict mode.