Skip to content

Instantly share code, notes, and snippets.

;(function() {
"use strict";
// Utility class to enable extension of objects that cannot use
// normal class based inheritance e.g. custom functions
//
// Simply put, it adds a mixin static that contains all the property
// descriptors that class intends to pass on
class Mixable {
static mixin(target) {
@matthewrobb
matthewrobb / array-like.mjs
Last active September 5, 2019 18:20
consumable-array.mjs
const {
defineProperties,
getOwnPropertyDescriptors
} = Object;
/**
* A root Array-like "class" compatible with both es5 and es6 styles
*/
export function ArrayLike() {
if (!(this instanceof ArrayLike)) {