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

848 B

id title challengeType videoUrl forumTopicId dashedName
cf1111c1c11feddfaeb6bdef 除法運算 1 https://scrimba.com/c/cqkbdAr 17566 divide-one-number-by-another-with-javascript

--description--

我們可以在 JavaScript 中做除法運算。

JavaScript 中使用 / 符號做除法運算。

示例

const myVar = 16 / 2;

現在,變量 myVar 的值爲 8

--instructions--

改變數值 0 來讓變量 quotient 的值等於 2

--hints--

要使 quotient 的值等於 2。

assert(quotient === 2);

使用 / 運算符。

assert(/\d+\s*\/\s*\d+/.test(code));

--seed--

--after-user-code--

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

--seed-contents--

const quotient = 66 / 0;

--solutions--

const quotient = 66 / 33;