object-mixin
A possible ES6 polyfill
API
// basic signatureObject:target // returns the target object modified // overload with Traits (Function) Object:target // returns the target object modified
Compatibility
Should be compatible with all JavaScript ES3 or JScript engines.
node.js module, AMD module, and generic env standalone file.
Example
// using an object var a = a: 'b' b = Object; console;// {"a":"a","b":"b"} // using a function { var privatelyShared = {} i = 0 ; if !prefix prefix = '.' + ; this { return privatelySharedkey || privatelySharedkey = ++i + prefix + Math ; };} {} Object; var instance1 = instance2 = ; console;
License
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2013 Andrea Giammarchi <spam@hater.me>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. You just DO WHAT THE FUCK YOU WANT TO.