3.0.1 • Published 4 years ago

objectplus.js v3.0.1

Weekly downloads
-
License
MIT
Repository
-
Last release
4 years ago

Object Plus

Requiring Functions

const objectplus = require("objectplus.js");

Object.prototype.push

This will add the discriminator into the new object.

Usage
const obj = {username: "Hyp3r"};
const newObj = obj.push({discriminator: "0001"});

// {username: "Extroonie", discriminator: "0001"}
console.log(newObj)

Object.prototype.remove

This will just simply remove a key and value from an object based on the specified key.

Usage
const obj = {username: "Hyp3r", discriminator: "0001"};

// {username: "Extroonie"}
obj.remove("tag")

Object.prototype.forEach

Loop through the object which return an object, example below.

Usage
const obj = {username: "Hyp3r", discriminator: "0001"};

obj.forEach(object => {
  // {key: "username", value: "Hyp3r"}
})