when I’m looking for some sites Javascript code, I see this
function hrefLeftMenu() {
var x = true;
for (i in info) {
$(".leftmenu ul").append("<li" + (x ? " class='active'" : "") + " onclick='openAnInfo(\"" + i + "\", this);'> - " + info[i].title + "</li>");
x = x??!x;
}
openAnInfo("0", ".lelelesakineyy");
}
What it does in javascript? Why the coder’s used this operator?
Thanks.
I think it is a mistake. They’re generating a menu and
xis used to set an item as active, and it looks like they want to default to selecting the first item. They wantxto be true the first time around, and then false for the rest. It was probably supposed to be something likeaka
but confusion/muddy thinking led to over-complification.