1.0.2 • Published 5 years ago

add-property-to-object v1.0.2

Weekly downloads
4
License
ISC
Repository
github
Last release
5 years ago

A simple and easy to use library to add properties to an object with an especific index

Usage:

let addProperty = require('add-property-to-object')
let obj = { place: "New World Pizza", location: 200 };
obj = addProperty(obj,{ especialty: "Pizza", dishes: [{ name: "American" }, { name: "Full Meat" }] }, 0);
console.log(obj);
//Obj now =
// {
//     especialty: 'Pizza',
//     dishes: [ { name: 'American' }, { name: 'Full Meat' } ],
//     place: 'New World Pizza',
//     location: 200
// }