Jump to content

&& Operator


eTianbun

Recommended Posts

err... both... I mean, both operands of the "&&" operator are evaluated if the left one is true-ish (i.e. if after being converted to a boolean, it evaluates to true).If you pass the result of this (e.g. "alert('eti' && 'anbun')") you get 'anbun', because this the last value that was evaluated. Similarly, if the left was false-ish, you'd get that value instead.The "||" operator works analogously - you get the left value if it's true-ish, the right value if the left one was false-ish.

Link to comment
Share on other sites

I don't fully understand the question...

When somebody type:
Type it and see what you're getting with it. Open up Firebug, go to console tab and type this.Beyond telling what you'll get ("anbun"), I don't really get the question. If it's about how the "&&" works, see this MDC page for details.
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...