Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Simple left-to-right mixin
var mixin = function () {
var args =;
var target = args.shift();
var source = args.shift();
// We don't need no hasOwnProperty checks!
for (var prop in source) {
target[prop] = source[prop];
if (args.length) {
return mixin.apply(null, args);
else {
return target;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment