2018-10-12 15:37:13 -04:00
|
|
|
---
|
|
|
|
title: Use the Conditional (Ternary) Operator
|
|
|
|
---
|
|
|
|
## Use the Conditional (Ternary) Operator
|
|
|
|
|
|
|
|
### Hint 1
|
|
|
|
Use ternary operator to check for equality.
|
|
|
|
|
|
|
|
### Warning Solution Ahead!!!
|
|
|
|
|
|
|
|
```javascript
|
|
|
|
function checkEqual(a, b) {
|
2018-11-06 20:44:51 -06:00
|
|
|
return (a == b ? true : false );
|
2018-10-12 15:37:13 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
checkEqual(1, 2);
|
|
|
|
```
|