1.2 KiB
1.2 KiB
id, title, challengeType, videoUrl, forumTopicId, localeTitle
id | title | challengeType | videoUrl | forumTopicId | localeTitle |
---|---|---|---|---|---|
bd7993c9ca9feddfaeb7bdef | Divide One Decimal by Another with JavaScript | 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;