[Solved] `$(“non_existing_element”);` returns `[ ]` in Console but `ReferenceError` when called as a variable in Console [closed]
[ad_1] 30 90 seconds about variable scoping $(document).ready(function(){ var someVar = $(“non_existing_element”); }); At this point, someVar does, in fact equal []. So if you were to write: $(document).ready(function(){ var someVar = $(“non_existing_element”); console.log(“the value of someVar is”, someVar); }); You would see in your console The value of someVar is [] Hooray! But! As … Read more