Skip to content

Commit

Permalink
replace == with ===
Browse files Browse the repository at this point in the history
  • Loading branch information
vsemozhetbyt committed Jan 9, 2017
1 parent 907617b commit 83a565e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -819,12 +819,12 @@ TypeScript (which, like I said, is a great alternative!).
**Bad:**
```javascript
function combine(val1, val2) {
if (typeof val1 == "number" && typeof val2 == "number" ||
typeof val1 == "string" && typeof val2 == "string") {
if (typeof val1 === 'number' && typeof val2 === 'number' ||
typeof val1 === 'string' && typeof val2 === 'string') {
return val1 + val2;
} else {
throw new Error('Must be of type String or Number');
}
throw new Error('Must be of type String or Number');
}
```

Expand Down

0 comments on commit 83a565e

Please sign in to comment.