Why am I able to use jQuery syntax in Chrome's JS console when current page doesn't have jQuery loaded?
google-chrome, javascript, jquery
Solution
Before, Chrome had an alias to `document.getElementById` with the `$` variable.
Recently (probably on Chrome 23 release), it has been changed to an alias to `document.querySelector`.
So your code is the equivalent of `document.querySelector('body')`.
Problem
I thought one has to have jQuery source loaded first in order to use `$` to target elements. I was on a webpage that doesn't even include any scripts but somehow I was able to run `$('body')` inside the Javascript console and Chrome successfully returned its value. Why didn't I get a syntax error like 'undefined token'? Thanks.