Skip to content

Commit ff3f70e

Browse files
author
Steve Thompson
committed
small change to README
1 parent dfa1dcd commit ff3f70e

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ The main reason you would use PublicArray is if you hate JavaScript's built-in A
66
like `.slice()`, `.splice()`, `.push()`, and `.shift()`. PublicArray has much clearer and expressive
77
method names, and a lot more of them. Examples:
88
```
9-
let arr = getPublicArray([1,2,3,4,5,6]);
9+
let arr = new PublicArray([1,2,3,4,5,6]);
1010
arr.remove.tail(2); // arr.data is now [1,2,3,4]
1111
arr.remove.head(1); // arr.data is now [2,3,4]
1212
@@ -28,19 +28,19 @@ npm install @writetome51/public-array
2828
## Loading
2929
```
3030
// If using TypeScript:
31-
import { getPublicArray } from '@writetome51/public-array';
31+
import { PublicArray } from '@writetome51/public-array';
3232
// If using ES5 JavaScript:
33-
var getPublicArray = require('@writetome51/public-array').getPublicArray;
33+
var PublicArray = require('@writetome51/public-array').PublicArray;
3434
```
3535

3636

3737
## Instantiation
3838
```
39-
getPublicArray(array = []): PublicArray
39+
new PublicArray(array = [])
4040
// Examples:
41-
// let arr = getPublicArray([1,2,3,4,5]);
41+
// let arr = new PublicArray([1,2,3,4,5]);
4242
// Or, instantiate with an empty array:
43-
// let arr = getPublicArray();
43+
// let arr = new PublicArray();
4444
```
4545

4646
## Properties
@@ -579,7 +579,7 @@ arr.set( [item1, item2, item3, ...] );
579579

580580
PublicArray has a large number of dependencies. You should keep this in mind when optimizing
581581
the performance of your app. For example, say your code only uses PublicArray's `.replace` property
582-
and nothing else. Since `.replace` is an instance of PublicArrayReplacer, you will get a
582+
and nothing else. Since `.replace` is an instance of PublicArrayReplacer, you may get a small
583583
performance boost if you just instantiate PublicArrayReplacer instead of PublicArray:
584584
```
585585
let replace = new PublicArrayReplacer(array);

0 commit comments

Comments
 (0)