I've searched in SO but I didn't find something similar. Maybe I am using wrong search keys.
I was editing a javascript library when I found this if
statment
var a = location.hash.replace(/^#/, "");
if (container = $("#content"), a) {
..content
} else {
...other code
}
the first part container = $("#content")
is assigning the value of $("#content")
to container but I don't understand why there is a comma inside the If. Is it like an AND
operator?
Something like if (container = $("#content") && a)
?
What is it evaluating?