Skip to content

Commit 27e66e8

Browse files
committed
Remove the new in examples
These are value types and shouldn't be constructable.
1 parent dca58ea commit 27e66e8

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

ImmutableMap.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Immutable Map
55

66
__Initialization__
77
```javascript
8-
const a = new ImmutableMap([['x', 1], ['y', 2]]);
8+
const a = ImmutableMap([['x', 1], ['y', 2]]);
99
```
1010

1111
__Extension__
@@ -15,7 +15,7 @@ const b = a.set('z', 3);
1515

1616
__Type__
1717
```javascript
18-
typeof new ImmutableMap(); // 'map'
18+
typeof ImmutableMap(); // 'map'
1919
```
2020

2121
### Prototype

ImmutableSet.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Immutable Set
55

66
__Initialization__
77
```javascript
8-
const a = new ImmutableSet([1, 2]);
8+
const a = ImmutableSet([1, 2]);
99
```
1010

1111
__Extension__
@@ -15,7 +15,7 @@ const b = a.add(3);
1515

1616
__Type__
1717
```javascript
18-
typeof new ImmutableSet(); // 'set'
18+
typeof ImmutableSet(); // 'set'
1919
```
2020

2121
### Prototype

ImmutableVector.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Immutable Vector
55

66
__Initialization__
77
```javascript
8-
const a = new ImmutableVector([1, 2]);
8+
const a = ImmutableVector([1, 2]);
99
```
1010

1111
__Initialization Sugar__

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ const xyz = #[ ...xy, z ]; // functional extension
3030
ImmutableMap is an immutable version of Map. Any mutable operation returns a new ImmutableMap instead of mutating the existing reference.
3131

3232
```javascript
33-
const a = new ImmutableMap([['x', 1], ['y', 2]]);
33+
const a = ImmutableMap([['x', 1], ['y', 2]]);
3434
const b = a.set('y', 3);
3535
a.get('y'); // 2
3636
b.get('y'); // 3
@@ -41,7 +41,7 @@ b.get('y'); // 3
4141
ImmutableSet is an immutable version of Set. Any mutable operation returns a new ImmutableSet instead of mutating the existing reference.
4242

4343
```javascript
44-
const a = new ImmutableSet([1, 2]);
44+
const a = ImmutableSet([1, 2]);
4545
const b = a.add(3);
4646
a.size; // 2
4747
b.size; // 3

Record.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Records
55

66
__Initialization__
77
```javascript
8-
const a = new Record({ x: 1, y: 2 });
8+
const a = Record({ x: 1, y: 2 });
99
```
1010

1111
__Initialization Sugar__
@@ -15,7 +15,7 @@ const a = #{ x: 1, y: 2 };
1515

1616
__Extension__
1717
```javascript
18-
const b = new Record(Object.assign({}, a, { z: 3 }));
18+
const b = Record(Object.assign({}, a, { z: 3 }));
1919
```
2020

2121
__Extension Sugar__

0 commit comments

Comments
 (0)