nullo
v1.0.2
Published
Create an object with `null` prototype, optionally merging other objects into it. Basically just somewhat less verbose than `Object.create(null, descriptors)` with a giant decriptors object.
Downloads
2
Readme
nullo
Create an object with null
prototype, optionally merging other objects into it. Basically just somewhat less verbose than Object.create(null, descriptors)
with a giant decriptors object.
var obj = nullo();
Object.getPrototypeOf(obj) === null // true;
Object.keys(obj) // []
var obj2 = nullo({letter: "a"}, {number: 1});
obj2; // {letter: "a", number: 1}
The merge algorithm is that of Object.assign
; it copies only own enumerable properties of arguments.