randommoon.js
v1.0.21
Published
A simple JavaScript library for generating random values
Downloads
445
Readme
randommoon.js
A simple JavaScript library for generating random values.
Installation:
npm:
npm i randommoon.js
How to use:
Import specific functions:
CommonJS:
const {Zeros} = require("randommoon.js");
import Statement:
import {Zeros} from "randommoon.js";
*Also import All functions with default as randommoon:
const randommoon = require("randommoon.js");
Array And 2d Array structure:
const shape = [rows,cols] // 2D Array structure
const shape = [rows] // 1D Array structure
example:
const var1 = Zeros(3);
console.log(var1.data); // Output: [0, 0, 0]
console.log(var1.shape) // Output: [3,0]
With 2D array:
const var2 = Zeros([3, 2]);
console.log(var2.data); // Output: [[0, 0], [0, 0], [0, 0]]
console.log(var1.shape) // Output: [3,2]