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

1.1 KiB

id, challengeType, videoUrl, forumTopicId, localeTitle
id challengeType videoUrl forumTopicId localeTitle
cf1111c1c11feddfaeb3bdef 1 https://scrimba.com/c/cM2KBAG 16650 加法运算

Description

Number是 JavaScript 中的一种数据类型,表示数值。 现在让我们来尝试在 JavaScript 中做加法运算。 JavaScript 中使用+号进行加法运算。 示例
myVar = 5 + 10; // assigned 15

Instructions

改变数字0让变量 sum 的值为20

Tests

tests:
  - text: <code>sum</code>应该等于<code>20</code>。
    testString: assert(sum === 20);
  - text: 要使用<code>+</code>运算符。
    testString: assert(/\+/.test(code));

Challenge Seed

var sum = 10 + 0;

After Test

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

Solution

var sum = 10 + 10;