(condition) ? valuetrue : valuefalse;
($isik1['age'] < $isik2['age']) ? -1 : 1; //returns -1 if true, 1 if false
switch ($i){ //or while
}
switch ($i): //or while
endswitch; //or endwhile
$myArr[0]
$myArr{0}
elementID
Example:
<span id='unicorn'>rainbow</span> //changes rainbow to sparkly
unicorn.innerHTML = 'sparkly';
myArr[0]
myObj["propertyName"]
myObj.propertyName
myObj.methodName()
function myFunction() {
return hours < 24 && minutes < 60 && seconds < 60;
}
Longer version:
function myFunction() {
if (hours < 24 && minutes < 60 && seconds < 60)
return true;
else
return false;
}
var myVariable = hours < 24 && minutes < 60 && seconds < 60;
Longer version:
var myVariable;
if (hours < 24 && minutes < 60 && seconds < 60)
myVariable = true;
else
myVariable = false;
if (!maxOptions) {
maxOptions = (type == 'number') ? chosenOptions : (!getOptionRange[2] ? minOptions : countOptions); //all braces can be removed (at the cost readability)
}
Longer version:
if (!maxOptions) {
if (type == 'number') {
maxOptions = chosenOptions;
}
else if (!getOptionRange[2]) {
maxOptions = minOptions;
}
else {
maxOptions = countOptions;
}
}