18 lines
285 B
Markdown
18 lines
285 B
Markdown
|
---
|
||
|
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) {
|
||
|
return (a = b ? true : false );
|
||
|
}
|
||
|
|
||
|
checkEqual(1, 2);
|
||
|
```
|