--- id: 63507ebb0c50ce3b9d669cd9 title: Step 8 challengeType: 0 dashedName: step-8 --- # --description-- Array methods can often be chained together to perform multiple operations at once. As an example: ```js array.map().filter(); ``` The `.map()` method is called on the array, and then the `.filter()` method is called on the result of the `.map()` method. This is called method chaining. Following that example, remove your `filtered` variable, and chain your `.filter()` call to your `.map()` call above. Do not remove either of the callback functions. # --hints-- You should remove the `filtered` variable. ```js assert.notMatch(calculate.toString(), /filtered/); ``` You should chain your `.filter()` call to your `.map()` call. ```js assert.match(calculate.toString(), /array\.map\(.*\)\.filter\(/s); ``` You should not remove the `.map()` callback. ```js assert.match(calculate.toString(), /(array\.map\(\s*(\(\s*el\s*\)|el)\s*=>|array\.map\(\s*function\s*\(\s*el\s*\)\s*\{)\s*(return\s+)?Number\(\s*el\s*\)/); ``` You should not remove the `.filter()` callback. ```js assert.match(calculate.toString(), /(\.filter\(\s*(\(\s*el\s*\)|el)\s*=>|\.filter\(\s*function\s*\(\s*el\s*\)\s*\{)\s*(return\s*)?!(Number\.)?isNaN\(\s*el\s*\)/s); ``` # --seed-- ## --seed-contents-- ```html Statistics Calculator

Statistics Calculator

Enter a list of comma-separated numbers.

The mean of a list of numbers is the average, calculated by taking the sum of all numbers and dividing that by the count of numbers.

Mean:

The median of a list of numbers is the number that appears in the middle of the list, when sorted from least to greatest.

Median:

The mode of a list of numbers is the number that appears most often in the list.

Mode:

The range of a list of numbers is the difference between the largest and smallest numbers in the list.

Range:

The variance of a list of numbers measures how far the values are from the mean, on average.

Variance:

The standard deviation of a list of numbers is the square root of the variance.

Standard Deviation:

``` ```css body { margin: 0; background-color: rgb(27, 27, 50); text-align: center; color: #fff; } button { cursor: pointer; background-color: rgb(59, 59, 79); border: 3px solid white; color: white; } input { background-color: rgb(10, 10, 35); color: white; border: 1px solid rgb(59, 59, 79); } .bold { font-weight: bold; } ``` ```js --fcc-editable-region-- const calculate = () => { const value = document.querySelector("#numbers").value; const array = value.split(/,\s*/g); const numbers = array.map(el => Number(el)); const filtered = numbers.filter(el => !isNaN(el)); } --fcc-editable-region-- ```