--- id: bd7993c9c69feddfaeb7bdef challengeType: 1 videoUrl: 'https://scrimba.com/c/ce2GeHq' forumTopicId: 301173 title: 两个小数相乘 --- ## Description 在 JavaScript 中,你也可以用小数进行计算,就像整数一样。 把两个小数相乘,并得到它们乘积。 ## Instructions 改变0.0的数值让变量product的值等于5.0。 ## Tests ```yml tests: - text: 变量product应该等于5.0。 testString: assert(product === 5.0); - text: 要使用*运算符。 testString: assert(/\*/.test(code)); ``` ## Challenge Seed ```js var product = 2.0 * 0.0; ``` ### After Test ```js (function(y){return 'product = '+y;})(product); ``` ## Solution ```js var product = 2.0 * 2.5; ```
0.0
product
5.0
*