GeezerVison is showing github.com — Some initial content · awronka/javascript@7287f17
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboard +5Lines changed: 5 additions & 0 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
|
| 1 | +# Summary |
| 2 | + |
| 3 | +* [Strings](strings/README.md) |
| 4 | + * [Basics](strings/basics.md) |
| 5 | + |
Collapse file
Copy file name to clipboard +3Lines changed: 3 additions & 0 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
|
| 1 | +# JavaScript Strings |
| 2 | + |
| 3 | +JavaScript strings share many similarities with string implementations from other high-level languages, such as Python's. They represent text based messages and data. |
Collapse file
Copy file name to clipboard +32Lines changed: 32 additions & 0 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
|
| 1 | +# JavaScript Basics |
| 2 | + |
| 3 | +Here we will cover the basics. How to create new strings and perform common operations on them. |
| 4 | + |
| 5 | +## Creation |
| 6 | + |
| 7 | +```js |
| 8 | +// Single quotes can be used |
| 9 | +var str = 'Our lovely string'; |
| 10 | + |
| 11 | +// Double quotes as well |
| 12 | +var otherStr = "Another nice string"; |
| 13 | +``` |
| 14 | + |
| 15 | +## Concatenation |
| 16 | + |
| 17 | +Concatenation involves adding two or more strings together, creating a larger string containing the combined data of those original strings. This is done in JavaScript using the **+** operator. |
| 18 | + |
| 19 | +```js |
| 20 | +var bigStr = 'Hi ' + 'JS strings are nice ' + 'and ' + 'easy to add'; |
| 21 | +``` |
| 22 | + |
| 23 | +**Note:** Strings can not be substracted, multiplied or divided. |
| 24 | + |
| 25 | +## Splitting |
| 26 | + |
| 27 | +Splitting a string breaks a string up into an array of smaller strings. |
| 28 | + |
| 29 | +```js |
| 30 | +var parts = 'We are separated by spaces'.split(' '); |
| 31 | +``` |
| 32 | + |