mirror of
https://github.com/Fechin/reference.git
synced 2026-11-20 21:23:11 +03:00
feat: add backtics to JS strings
This commit is contained in:
1 parent
8afb7b16e2
commit
adb50fe16a
1 file changed
+9
-3
@@ -60,11 +60,17 @@ console.log(a); // => undefined
|
||||
### Strings
|
||||
|
||||
```javascript
|
||||
let single = 'Wheres my bandit hat?';
|
||||
let double = 'Wheres my bandit hat?';
|
||||
let singleQuotes = 'Wheres my bandit hat?';
|
||||
let doubleQuotes = 'Wheres my bandit hat?';
|
||||
// this is used to embed expressions or for creating multi-line strings
|
||||
let backTicks = `Wheres my bandit hat? ${some_value}`;
|
||||
|
||||
// they can also be mixed,
|
||||
// NOTE: if you need the functionality of the backticks, use it as the surrounding quotes
|
||||
let mixedQuotes = `hello ${'dear' + name}, "let's have a great day today`;
|
||||
|
||||
// => 21
|
||||
console.log(single.length);
|
||||
console.log(singleQuotes.length);
|
||||
```
|
||||
|
||||
### Arithmetic Operators
|
||||
|
||||
Reference in new issue
Block a user