We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 856a4f2 commit 55d8b21Copy full SHA for 55d8b21
manual/en-US/coding-standards/chapters/javascript.md
@@ -332,15 +332,26 @@ $('.someElement')
332
```
333
334
### Hoisting
335
+## Conditional Statements
336
-// TODO
337
+Use ternary syntax if:
338
339
+- One condition
340
+- Result of either evaluation is one operation.
341
342
+```
343
+joomlaRocks ? 'This is true' : 'else it is false';
344
345
-## Conditional Statements
346
+Otherwise, use standard syntax:
347
-// TODO ternary/with braces
348
349
+if ( condition ) {
350
+ // statements
351
+} else {
352
353
+}
354
355
356
**Cache length in variable for performance:**
357
0 commit comments