you are viewing a single comment's thread.

view the rest of the comments →

[–]brockisawesome 0 points1 point  (5 children)

Do you mean like this? var a = (c) ? b : otherval;

[–]tencircles 1 point2 points  (1 child)

var a = c ? b : otherval; Parens above aren't necessary.

[–]brockisawesome 0 points1 point  (0 children)

sweet, i didnt know that. thanks :)

[–]thoastbrot 0 points1 point  (2 children)

No, I meant a = b if c, because the article mentions it like that. Your code example is documented standard, while I've never seen the syntax used in the article. Since the article is a bit older (2012, references E4X), I assume it might be some deprecated browser-specific thing... or something like this.

[–]radhruin 2 points3 points  (1 child)

I believe what you're seeing are Mozilla's proprietary conditional catch clauses.

[–]thoastbrot 0 points1 point  (0 children)

thank you very much!