2020-10-06 23:10:08 +05:30

1.1 KiB

id, challengeType, videoUrl, forumTopicId, title
id challengeType videoUrl forumTopicId title
bd7993c9ca9feddfaeb7bdef 1 https://scrimba.com/c/cBZe9AW 18255 两个小数相除

Description

现在让我们将一个小数除以另一个小数。

Instructions

改变数值0.0的值让变量quotient的值等于2.2.

Tests

tests:
  - text: <code>quotient</code>的值应该等于<code>2.2</code>。
    testString: assert(quotient === 2.2);
  - text: 使用<code>/</code>运算符将 4.4 除以 2。
    testString: assert(/4\.40*\s*\/\s*2\.*0*/.test(code));
  - text: quotient 变量应该只被赋值一次。
    testString: assert(code.match(/quotient/g).length === 1);

Challenge Seed

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

After Test

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

Solution

var quotient = 4.4 / 2.0;