I always thought I could just check an undefined var by comparing it to undefined, but this is the error I get in the chrome console :
The variable called "jQuery" in your code has never been declared, so it will throw an error like "xxx(variable name) is not defined".
You can use the typeof operator to check is a variable is undefined or not
typeof
if (typeof(jQuery) == "undefined")