Skip to content

Instantly share code, notes, and snippets.

@wentout
Last active August 21, 2020 13:31
Show Gist options
  • Save wentout/087850b20846fe2571f585ae1726a3d8 to your computer and use it in GitHub Desktop.
Save wentout/087850b20846fe2571f585ae1726a3d8 to your computer and use it in GitHub Desktop.
// Explorable! Document or Data Flow Definition...
// explorable Document Flow Definition
const NUMBER_2_EXPLORE_FROM = new Number(5);
const someData4DFD = [5, 4, 3, 2, 1];
const ExplorableDFD = function (explorable) {
const proto = Object.getPrototypeOf(this);
const protoValue = proto.valueOf();
debugger;
this.someDataFromNumber = [];
explorable.forEach((data, idx) => {
debugger;
this.someDataFromNumber[idx] = data * protoValue;
});
};
ExplorableDFD.prototype = NUMBER_2_EXPLORE_FROM;
ExplorableDFD.prototype.constructor = ExplorableDFD;
const explorableInstance = new ExplorableDFD(someData4DFD);
console.log('*** the DFD Results ***');
console.log(explorableInstance);
console.log(explorableInstance.someDataFromNumber);
console.log(explorableInstance instanceof ExplorableDFD);
console.log(explorableInstance instanceof Number);
debugger;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment