For performance, I’ll often save references to dom elements in a var, such as:
var $header = $("#header");
If I have multiple elements, I’d like to be able to do something like:
var someNamespace = {
$header : $("#header"),
$footer : $("#footer")
}
The latter seems to throw an error. How do you handle this without creating a ton of vars?
Your code:
replace
=with:This is the syntax for
object literalsdeclarations.Read more in MDN