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

Skip to content

Commit c92b792

Browse files
committed
use single quotes consistently
1 parent 907617b commit c92b792

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -819,8 +819,8 @@ 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;
825825
} else {
826826
throw new Error('Must be of type String or Number');
@@ -1407,7 +1407,7 @@ classes until you find yourself needing larger and more complex objects.
14071407
```javascript
14081408
const Animal = function(age) {
14091409
if (!(this instanceof Animal)) {
1410-
throw new Error("Instantiate Animal with `new`");
1410+
throw new Error('Instantiate Animal with `new`');
14111411
}
14121412

14131413
this.age = age;
@@ -1417,7 +1417,7 @@ Animal.prototype.move = function() {};
14171417

14181418
const Mammal = function(age, furColor) {
14191419
if (!(this instanceof Mammal)) {
1420-
throw new Error("Instantiate Mammal with `new`");
1420+
throw new Error('Instantiate Mammal with `new`');
14211421
}
14221422

14231423
Animal.call(this, age);
@@ -1430,7 +1430,7 @@ Mammal.prototype.liveBirth = function() {};
14301430

14311431
const Human = function(age, furColor, languageSpoken) {
14321432
if (!(this instanceof Human)) {
1433-
throw new Error("Instantiate Human with `new`");
1433+
throw new Error('Instantiate Human with `new`');
14341434
}
14351435

14361436
Mammal.call(this, age, furColor);

0 commit comments

Comments
 (0)