Skip to content

Commit fcfab4e

Browse files
Merge pull request ryanmcdermott#91 from vsemozhetbyt/eqeqeq
replace == with ===
2 parents c613772 + 83a565e commit fcfab4e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -822,12 +822,12 @@ TypeScript (which, like I said, is a great alternative!).
822822
**Bad:**
823823
```javascript
824824
function combine(val1, val2) {
825-
if (typeof val1 == "number" && typeof val2 == "number" ||
826-
typeof val1 == "string" && typeof val2 == "string") {
825+
if (typeof val1 === 'number' && typeof val2 === 'number' ||
826+
typeof val1 === 'string' && typeof val2 === 'string') {
827827
return val1 + val2;
828-
} else {
829-
throw new Error('Must be of type String or Number');
830828
}
829+
830+
throw new Error('Must be of type String or Number');
831831
}
832832
```
833833

0 commit comments

Comments
 (0)