Skip to content

Commit c8fcd2c

Browse files
authored
Update README.md
1 parent 5341663 commit c8fcd2c

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
@@ -947,11 +947,11 @@
947947
<a name="strings--quotes"></a><a name="6.1"></a>
948948
- [6.1](#strings--quotes) Use double quotes `""` for strings instead of single quotes `''`. eslint: [`quotes`](https://eslint.org/docs/rules/quotes.html)
949949
950-
> Why? While other Styleguides may enforce single quotes, they mostly do it because of consistency. Here are some reasons for using double quotes: <br>
950+
> Why? While other Styleguides may enforce single quotes, they mostly do it because of consistency (in favor of older projects). Here are some reasons for using double quotes: <br>
951951
> - Double quotes eliminate the need to escape apostrophes: `"I'm"` vs `'I\'m'`.
952952
> - From a linguistic point of view, double quotes identify a passage of quoted text while single quotes are commonly used as a contraction.
953953
> - Double quotes are used to define strings in many other languages. Single quotes are used to define `char`'s in some.
954-
> - JSON notation is written with double quotes as well.
954+
> - JSON Strings are only valid with double quotes.
955955
956956
```javascript
957957
// bad
@@ -1046,9 +1046,9 @@
10461046
const profileRegex = new RegExp(baseSite + "user\/(\w+)", "gi");
10471047

10481048
// good
1049-
const uploadsRegex = /http(?:s?):\/\/website\.com\/(?:top|new|user\/\w+\/(?:uploads|likes))(?:(?:\/\w+)?)\/(\d+)/gi,
1050-
const commentRegex = /http(?:s?):\/\/website\.com\/(?:top|new|user\/\w+\/(?:uploads|likes))(?:(?:\/\w+)?)\/(\d+)(?:(?::)comment(\d+))/gi,
1051-
const profileRegex = /http(?:s?):\/\/website\.com\/user\/(\w+)/gi
1049+
const uploadsRegex = /http(?:s?):\/\/website\.com\/(?:top|new|user\/\w+\/(?:uploads|likes))(?:(?:\/\w+)?)\/(\d+)/gi;
1050+
const commentRegex = /http(?:s?):\/\/website\.com\/(?:top|new|user\/\w+\/(?:uploads|likes))(?:(?:\/\w+)?)\/(\d+)(?:(?::)comment(\d+))/gi;
1051+
const profileRegex = /http(?:s?):\/\/website\.com\/user\/(\w+)/gi;
10521052
```
10531053
10541054
**[⬆ back to top](#table-of-contents-bookmark_tabs)**

0 commit comments

Comments
 (0)