baylitjs
v1.0.5
Published
BaylitJS for NodeJS.
Downloads
1
Readme
BaylitJS
JavaScript library of BaylitJS standart.
Installation
npm install baylitjs
Usage
require("baylitjs")();
Array
const Arr1 = [1, 2, 3];
const Arr2 = [3, 4, 5];
Arr1.common(Arr2); // [3]
Arr1.diff(Arr2); // [1, 2]
Arr1.symdiff(Arr2); // [1, 2, 4, 5]
Arr1.shuffle(); // [3, 1, 2]
Arr1.max(); // 3
Arr1.min(); // 1
Arr1.mid(); // 2
Arr1.random(); // 2
Arr1.editByIndex(0, 3); // [3, 2, 3]
Arr1.editByValue(2, 3); // [1, 3, 3]
Arr1.clear(); // []
Arr1.combine(Arr2); // [1, 2, 3, 3, 4, 5]
Arr1.equal(Arr2); // false
Arr1.subtract(1); // [2, 3]
Arr1.pushByIndex(0, 4); // [4, 1, 2, 3]
Arr1.pushByValue(2, 5); // [1, 2, 5, 3]
Object
const Obj1 = {baylitjs : "lib", baylitdb: "json"};
const Obj2 = {db : "baylit"};
Obj1.toArray(); // [["baylit","db"]]
Obj1.equal(Obj2); // false
Obj1.first(); // "lib"
Obj1.last(); // "json"
Both
(1234).numberCut(3, ","); // 1,234
("12345").numberCut(3, "."); // 12.345
//Default format {hour}:{min}:{sec}.{ms} {day}/{month}/{year}
(12939213912).convertToTime(); // 20:13:33.91 30/05/1970
Discord: Yiit#9184