1.0.2 • Published 2 years ago

js-datastruct v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Importing packages

import {Tuple} from "js-datastruct"

Tuple

const tuple = new Tuple(1, 2, 3)

tuple[0] = 2

console.log(tuple[0]) //-> 2

tuple[4] = 3; //-> RangeError: The last index of the tuple is 2

tuple[4]; //-> RangeError: The last index of the tuple is 2

Tuple works with many array inbuilt methods, but not with push, pop, unshift, shift

tuple.push(3) //-> TypeError: Invalid method. Tuple can't change its length

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago