This practice touches the following:
- Basics of prototype inheritance.
- ES6 features.
- BDD with Mocha and Chai.
- NPM infrastructure.
Please implement spacify function extending prototype of native String class. This function should compute string with space injected between chars of the original string. As follows:
- "ABC".spacify() // "A B C"
- "A".spacify() // "A"
- "".spacify() // ""
Do not do such dirty things in production. This task is just for understanding of prototype inheritance.
Please take a look at bind operator for inspiration.
- Fork this repository.
- Checkout forked repository.
- Install Node.js.
- Install project dependencies by
npm install. - Run tests by
npm run test(tests should fail). - Go to the src folder and implement spacify module.
- Tune ESLint to complete this task without static analysis errors.
- Check your progress against specification (tests).