14.07.2013 Views

Essentials of Javascript - Cultural View

Essentials of Javascript - Cultural View

Essentials of Javascript - Cultural View

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

?: 54<br />

Furthermore, the ternary operator can yield an lvalue, i.e. a value to which another value can be assigned. Consider<br />

the following example:<br />

#include <br />

int main () {<br />

}<br />

int a=0, b=0;<br />

const bool cond = ...;<br />

(cond ? a : b) = 1;<br />

std::cout

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!