|
hello,
Can someone help me, i'm idiot in javascript.
Someone can expalain to me what the numbering in the end of line means.---> ?0:1;
abc_element = (!document.getElementById("abc") )?0:1;
Thanks in advance.
|
|
|
I reckon this is getting the result of the operation, and returning a 0 or a 1 dependent on the result returned. So !document.getElementById("abc") is maybe returning a value. 0 or 1 like booleans. True or False.
Like in c++:
? : Ternary conditional (if-then-else) int i = (a > b) ? a : b; right to left
|
|
|
|
|
|
|
// |