1.2 KiB
Raw Blame History

id, title, challengeType, videoUrl, localeTitle
id title challengeType videoUrl localeTitle
cf1111c1c11feddfaeb3bdef Add Two Numbers with JavaScript 1 使用JavaScript添加两个数字

Description

Number是JavaScript中的数据类型表示数字数据。现在让我们尝试使用JavaScript添加两个数字。当放置在两个数字之间时JavaScript使用+符号作为加法运算。
myVar = 5 + 10; //分配15

Instructions

更改0使总和等于20

Tests

tests:
  - text: <code>sum</code>应该等于<code>20</code>
    testString: 'assert(sum === 20, "<code>sum</code> should equal <code>20</code>");'
  - text: 使用<code>+</code>运算符
    testString: 'assert(/\+/.test(code), "Use the <code>+</code> operator");'

Challenge Seed

var sum = 10 + 0;

After Test

console.info('after the test');

Solution

// solution required