javascript - Found this in the jquery source, how does it work? -
all 1 expression. gets put inside div in end? what's called when have bunch of comma delimited expressions?
var div = document.createelement( "div" ), documentelement = document.documentelement, all, a, select, opt, input, tds, events, eventname, i, issupported;
it declaration of bunch of variables inside function scope. first 2 variables initialized declaration. can declare/initialize multiple variables @ once separating each comma done here.
in other uses, comma character operator in javascript. mdn: the comma operator evaluates both of operands (from left right) , returns value of second operand.
the variable div
initialized here empty div tag. there nothing inside yet until later code uses it. code following in jquery, puts content div , runs series of test operations on feature tests , see features supported in current browser.
Comments
Post a Comment