2 ms·
> No JS interpreter runs a function you define until you call it. Right, but the browser can call it, that's the possibility we're dealing with here. If I assi
by jaffathecake 13y ago
> No JS interpreter runs a function you define until you call it.
Right, but the browser can call it, that's the possibility we're dealing with here. If I assigned the code to window.onload rather than onresize, it would be called (by the browser).
With the first phase of the onresize stage, the question was "does the browser call this without user interaction?". And hey, if the question had the page in an iframe, the function would be called in IE.
Since a browser is so close to actually calling the function unexpectedly, I don't think it's unreasonable.
> Technically, this could still very well happen without user interaction: consider gravity pulling out a display cable and causing the window to be relocated/resized by the OS
I think it's reasonable and clear that the questions deal with the code presented and there's no outside influence unless stated. The point about no user interaction is emphasis, it's implicit throughout the quiz. Otherwise the user interaction could be the user opening devtools & adding code to the page to make the request, making every answer 'yes'.
> Incorrect. It's a deceitful quiz.
Crikey.