Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 83a565e

Browse files
committed
replace == with ===
1 parent 907617b commit 83a565e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -819,12 +819,12 @@ TypeScript (which, like I said, is a great alternative!).
819819
**Bad:**
820820
```javascript
821821
function combine(val1, val2) {
822-
if (typeof val1 == "number" && typeof val2 == "number" ||
823-
typeof val1 == "string" && typeof val2 == "string") {
822+
if (typeof val1 === 'number' && typeof val2 === 'number' ||
823+
typeof val1 === 'string' && typeof val2 === 'string') {
824824
return val1 + val2;
825-
} else {
826-
throw new Error('Must be of type String or Number');
827825
}
826+
827+
throw new Error('Must be of type String or Number');
828828
}
829829
```
830830

0 commit comments

Comments
 (0)