Skip to content

Commit 7287f17

Browse files
author
Aaron O'Mullan
committed
Some initial content
1 parent dbd6008 commit 7287f17

3 files changed

Lines changed: 40 additions & 0 deletions

File tree

‎SUMMARY.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Summary
2+
3+
* [Strings](strings/README.md)
4+
* [Basics](strings/basics.md)
5+

‎strings/README.md‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
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.

‎strings/basics.md‎

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
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+

0 commit comments

Comments
 (0)