0.0.7 • Published 3 years ago
dijes-collection v0.0.7
dijes-Collection
Download
npm install dijes-collection --save
Using
const Collection = require("dijes-collection")
var collection = new Collection({limit:-1}) // -1 - infinity elements, for change the limit of elements provide the positive number
Add elements
collection.set("1",{ number:1, text:"first element"})
// [["1"], [{number:1, text:"first element"}]]
Remove items
collection.set("1", 1)
//[["1"], [1]]
collection.remove("1")
//[[], []]
Check availability items
collection.set("foo", "bar")
collection.has("foo") //true
collection.has("bar") //false
Get items
collection.set("foo", "bar")
collection.get("foo")//"bar"