--- id: 6352f2a24eb71b24284ca2b6 title: Step 45 challengeType: 0 dashedName: step-45 --- # --description-- The variance of a series represents how much the data deviates from the mean, and can be used to determine how spread out the data are. The variance is calculated in a few steps. Start by declaring a `getVariance` function that takes an `array` parameter. Within that function, declare a `mean` variable and assign it the value of the `getMean` function, passing `array` as the argument. # --hints-- You should define a `getVariance` function. ```js assert.isFunction(getVariance); ``` Your `getVariance` function should take an `array` parameter. ```js assert.match(getVariance.toString(), /array/); ``` Your `getVariance` function should declare a `mean` variable. ```js assert.match(getVariance.toString(), /mean\s*=/); ``` Your `mean` variable should be assigned the value of the `getMean` function, passing the `array` argument. ```js assert.match(getVariance.toString(), /mean\s*=\s*getMean\(\s*array\s*\)\s*;?/); ``` # --seed-- ## --seed-contents-- ```html
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: