From 2c8ada2ce9cbf05aa261035ddc7443b5bf5bb850 Mon Sep 17 00:00:00 2001 From: Steven Primeaux <58159084+Auxdible@users.noreply.github.com> Date: Thu, 18 Apr 2024 13:07:08 -0400 Subject: [PATCH] fix(curriculum): unclear messages in step 54 of statistic calculator (#54441) --- .../6353004b235d7a2e0b913f2b.md | 25 +++++++++++++------ 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-advanced-array-methods-by-building-a-statistics-calculator/6353004b235d7a2e0b913f2b.md b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-advanced-array-methods-by-building-a-statistics-calculator/6353004b235d7a2e0b913f2b.md index 236f4504b2a..b2756aedf95 100644 --- a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-advanced-array-methods-by-building-a-statistics-calculator/6353004b235d7a2e0b913f2b.md +++ b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-advanced-array-methods-by-building-a-statistics-calculator/6353004b235d7a2e0b913f2b.md @@ -7,7 +7,22 @@ dashedName: step-54 # --description-- -To calculate a root exponent, such as $\sqrt[n]{x}$, you can use an inverted exponent $x^{1/n}$. +To calculate a root exponent, such as $\sqrt[n]{x}$, you can use an inverted exponent $x^{1/n}$. JavaScript has a built-in `Math.pow()` function that can be used to calculate exponents. + +Here is the basic syntax for the `Math.pow()` function: + +```js +Math.pow(base, exponent); +``` + +Here is an example of how to calculate the square root of `4`: + +```js +const base = 4; +const exponent = 0.5; +// returns 2 +Math.pow(base, exponent); +``` Declare a `standardDeviation` variable, and use the `Math.pow()` function to assign it the value of $variance^{1/2}$. @@ -25,13 +40,7 @@ Your `standardDeviation` variable should use the `Math.pow()` function. assert.match(getStandardDeviation.toString(), /standardDeviation\s*=\s*Math\.pow\(/); ``` -Your `standardDeviation` variable should use the `variance` variable. - -```js -assert.match(getStandardDeviation.toString(), /standardDeviation\s*=\s*Math\.pow\(\s*variance\s*,/); -``` - -Your `standardDeviation` variable should use the `1/2` exponent. +Your `Math.pow()` function should have a base of `variance` and an exponent of `1/2`. ```js assert.match(getStandardDeviation.toString(), /standardDeviation\s*=\s*Math\.pow\(\s*variance\s*,\s*1\s*\/\s*2\s*\)/);