I am learning JS now and can not understand why 'use strict' directive does not work for a callback for setTimeout? As I know for use strict it should be undefined but always have global object.
function f() {
'use strict'
console.log(this === window)
}
function g() {
console.log(this === window)
}
setTimeout(g,1000) // expect true, have true
setTimeout(f,1000) // expect false, have true