1.0.0 • Published 8 years ago
raw-object v1.0.0
raw-object
Install
npm install --save raw-object
Usage
const rawObject = require('raw-object');
//Create an object with no properties.
let one = rawObject();
//Assign properties to the object
let two = rawObject({
prop1: 'one'
});
//Extend the created object
let three = rawObject(one, two, {
prop2: 'two'
});
console.log('two.prop1 ',two.prop1); //one
console.log('three.prop1 ',three.prop1); //one
console.log('three.prop2 ',three.prop2); //two
About
Use this to create an object with a null prototype.
A null prototype makes it easier to check with the in
operator like name in object
.
1.0.0
8 years ago