freeCodeCamp/curriculum/challenges/chinese-traditional/02-javascript-algorithms-an.../basic-javascript/divide-one-decimal-by-anoth...

879 B

id title challengeType videoUrl forumTopicId dashedName
bd7993c9ca9feddfaeb7bdef 兩個小數相除 1 https://scrimba.com/c/cBZe9AW 18255 divide-one-decimal-by-another-with-javascript

--description--

現在讓我們將一個小數除以另一個小數。

--instructions--

改變數值 0.0 的值讓變量 quotient 的值等於 2.2

--hints--

quotient 的值應該等於2.2

assert(quotient === 2.2);

使用 / 運算符將 4.4 除以 2。

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

quotient 變量應該只被賦值一次。

assert(code.match(/quotient/g).length === 1);

--seed--

--after-user-code--

(function(y){return 'quotient = '+y;})(quotient);

--seed-contents--

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

--solutions--

var quotient = 4.4 / 2.0;