Last active
August 21, 2020 13:31
-
-
Save wentout/087850b20846fe2571f585ae1726a3d8 to your computer and use it in GitHub Desktop.
// Explorable! Document or Data Flow Definition...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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