Skip to content

Commit fac32f8

Browse files
authored
Advise against using new tuple(...).
1 parent d4c491e commit fac32f8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ npm test # if skeptical
2121

2222
## Usage
2323

24-
The npm package exports a single function called `tuple`, both as a `default` export and as an equivalent named export, so all of the following import styles will work:
24+
This package exports a single function called `tuple`, both as a `default` export and as an equivalent named export, so all of the following import styles will work:
2525

2626
```js
2727
import tuple from "immutable-tuple";
@@ -45,6 +45,8 @@ assert.strictEqual(t1 === t2, true);
4545
assert.strictEqual(t1, t2);
4646
```
4747

48+
Although the `tuple` function can be invoked using `new tuple(...)` syntax, using `new` is not recommended, since the new object will simply be thrown away.
49+
4850
### Own `tuple` properties
4951

5052
The `tuple` object has a fixed numeric `.length` property, and its elements may be accessed using array index notation:

0 commit comments

Comments
 (0)