Functional Programming
Declarative Programming
Programming Paradigms
Higher-order Functions
Functions
Control Flow
Basic Language Features
Fundamentals
Arrays
Data Types
Iterators
Object-oriented Programming
// logic Number.prototype[Symbol.iterator] = function * (){ for (let i=0;i<=this;i++) { yield i } } // you can use this to create your own range
// logicNumber.prototype[Symbol.iterator] = function * (){for (let i=0;i<=this;i++) {yield i}}- // logic
- Number.prototype[Symbol.iterator] = function * (){
- for (let i=0;i<=this;i++) {
- yield i
- }
- }
- // you can use this to create your own range
// TODO: Add your tests here // Starting from Node 10.x, [Mocha](https://mochajs.org) is used instead of our custom test framework. // [Codewars' assertion methods](https://github.com/Codewars/codewars.com/wiki/Codewars-JavaScript-Test-Framework) // are still available for now. // Number.prototype[Symbol.iterator] = function * (){ for (let i=0;i<=this;i++) { yield i } } // For new tests, using [Chai](https://chaijs.com/) is recommended. // You can use it by requiring: const assert = require("chai").assert; // If the failure output for deep equality is truncated, `chai.config.truncateThreshold` can be adjusted. describe("Solution", function() { it("should test for something", function() { assert.deepEqual([...5],[0,1,2,3,4,5]); assert.deepEqual([...2,...3],[0,1,2,0,1,2,3] ); }); });
// TODO: Add your tests here// Starting from Node 10.x, [Mocha](https://mochajs.org) is used instead of our custom test framework.// [Codewars' assertion methods](https://github.com/Codewars/codewars.com/wiki/Codewars-JavaScript-Test-Framework)// are still available for now.//Number.prototype[Symbol.iterator] = function * (){for (let i=0;i<=this;i++) {yield i}}// For new tests, using [Chai](https://chaijs.com/) is recommended.// You can use it by requiring:const assert = require("chai").assert;// If the failure output for deep equality is truncated, `chai.config.truncateThreshold` can be adjusted.describe("Solution", function() {it("should test for something", function() {assert.deepEqual([...5],[0,1,2,3,4,5]);assert.deepEqual([...2,...3],[0,1,2,0,1,2,3] );});});- // TODO: Add your tests here
- // Starting from Node 10.x, [Mocha](https://mochajs.org) is used instead of our custom test framework.
- // [Codewars' assertion methods](https://github.com/Codewars/codewars.com/wiki/Codewars-JavaScript-Test-Framework)
- // are still available for now.
- //
- Number.prototype[Symbol.iterator] = function * (){
- for (let i=0;i<=this;i++) {
- yield i
- }
- }
- // For new tests, using [Chai](https://chaijs.com/) is recommended.
- // You can use it by requiring:
- const assert = require("chai").assert;
- // If the failure output for deep equality is truncated, `chai.config.truncateThreshold` can be adjusted.
- describe("Solution", function() {
- it("should test for something", function() {
- assert.deepEqual([...5],[0,1,2,3,4,5]);
- assert.deepEqual([...2,...3],[0,1,2,0,1,2,3] );
- });
- });