Last active
December 23, 2018 21:04
-
-
Save ioxua/49581f47f31d5b35421856e5f01927f0 to your computer and use it in GitHub Desktop.
Dwemthy's Array ES6 -- medium post 2
This file contains 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
const creatureFactory = ( | |
name, life, strength, charisma, weapon, customProps | |
) => function create() { | |
return { | |
name, life, strength, | |
charisma, weapon | |
// ... | |
} | |
}; | |
const Rabbit = creatureFactory("Rabbit", 10, 2, 44, 4 /* more here */); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment