eTianbun Posted March 6, 2012 Share Posted March 6, 2012 When somebody type: 'eti' && 'anbun' Which command is (s)he passing to the browser(s)? Link to comment Share on other sites More sharing options...
boen_robot Posted March 6, 2012 Share Posted March 6, 2012 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 More sharing options...
eTianbun Posted March 6, 2012 Author Share Posted March 6, 2012 I dont realy get, plz explain MORE... Link to comment Share on other sites More sharing options...
boen_robot Posted March 6, 2012 Share Posted March 6, 2012 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.