?:
Posted 13. April 2008 at 19:10Categories: kelko explains
Many people doesn’t seem to understand the ?:-Notation. But it’s quite easy.
var = foo ? val1 : val2
Doesn’t mean anything more then:
(Using C/C++/Java/… notation)
if (foo) {
var = val1;
} else {
var = val2
}
(Using ruby, … notation)
if foo then
var = val1
else
var = val2
end