Files
freeCodeCamp/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/divide-one-decimal-by-another-with-javascript.md
2025-03-07 11:28:43 +01:00

842 B

id, title, challengeType, forumTopicId, dashedName
id title challengeType forumTopicId dashedName
bd7993c9ca9feddfaeb7bdef Divide One Decimal by Another with JavaScript 1 18255 divide-one-decimal-by-another-with-javascript

--description--

Now let's divide one decimal by another.

--instructions--

Change the 0.0 so that quotient will equal to 2.2.

--hints--

The variable quotient should equal 2.2

assert(quotient === 2.2);

You should use the / operator to divide 4.4 by 2

assert(/4\.40*\s*\/\s*2\.*0*/.test(__helpers.removeJSComments(code)));

The quotient variable should only be assigned once

assert(__helpers.removeJSComments(code).match(/quotient\s*=/g).length === 1);

--seed--

--seed-contents--

const quotient = 0.0 / 2.0; // Change this line

--solutions--

const quotient = 4.4 / 2.0;