--- id: 642e004130958c3975aa3a4a title: Step 9 challengeType: 0 dashedName: step-9 --- # --description-- Currently your `range` function returns an array with the correct length, but all of the values are the value of `start`. To fix this, chain the `.map()` method to your `.fill()` method. Pass the `.map()` method a callback which takes `element` and `index` as parameters and returns the sum of those parameters. # --hints-- You should use the `.map()` method. ```js assert.match(code, /\.map\(/); ``` You should chain the `.map()` method to your `.fill()` method. ```js assert.match(code, /const\s+range\s*=\s*\(\s*start\s*,\s*end\s*\)\s*=>\s*Array\(\s*end\s*-\s*start\s*\+\s*1\s*\)\.fill\(\s*start\s*\)\.map\(/); ``` You should pass a callback function to `.map()` using arrow syntax. ```js assert.match(code, /const\s+range\s*=\s*\(\s*start\s*,\s*end\s*\)\s*=>\s*Array\(\s*end\s*-\s*start\s*\+\s*1\s*\)\.fill\(\s*start\s*\)\.map\(\s*\(.*\)\s*=>/); ``` Your `.map()` callback should take `element` as the first parameter. ```js assert.match(code, /const\s+range\s*=\s*\(\s*start\s*,\s*end\s*\)\s*=>\s*Array\(\s*end\s*-\s*start\s*\+\s*1\s*\)\.fill\(\s*start\s*\)\.map\(\s*\(\s*element/); ``` Your `.map()` callback should take `index` as the second parameter. ```js assert.match(code, /const\s+range\s*=\s*\(\s*start\s*,\s*end\s*\)\s*=>\s*Array\(\s*end\s*-\s*start\s*\+\s*1\s*\)\.fill\(\s*start\s*\)\.map\(\s*\(\s*element\s*,\s*index\s*\)\s*=>/); ``` Your `.map()` callback should use an implicit return. ```js assert.notMatch(code, /const\s+range\s*=\s*\(\s*start\s*,\s*end\s*\)\s*=>\s*Array\(\s*end\s*-\s*start\s*\+\s*1\s*\)\.fill\(\s*start\s*\)\.map\(\s*\(\s*element\s*,\s*index\s*\)\s*=>\s*\{/); ``` Your `.map()` callback should implicitly return the sum of `element` and `index`. ```js assert.match(code, /const\s+range\s*=\s*\(\s*start\s*,\s*end\s*\)\s*=>\s*Array\(\s*end\s*-\s*start\s*\+\s*1\s*\)\.fill\(\s*start\s*\)\.map\(\s*\(\s*element\s*,\s*index\s*\)\s*=>\s*(element\s*\+\s*index|index\s*\+\s*element)/); ``` # --seed-- ## --seed-contents-- ```html