Valeriy 79d9012432 fix(curriculum): quotes in tests (#18828)
* fix(curriculum): tests quotes

* fix(curriculum): fill seed-teardown

* fix(curriculum): fix tests and remove unneeded seed-teardown
2018-10-20 23:32:47 +05:30

1.2 KiB

id, title, challengeType
id title challengeType
cf1111c1c11feddfaeb3bdef Add Two Numbers with JavaScript 1

Description

Number is a data type in JavaScript which represents numeric data. Now let's try to add two numbers using JavaScript. JavaScript uses the + symbol as addition operation when placed between two numbers. Example
myVar = 5 + 10; // assigned 15

Instructions

Change the 0 so that sum will equal 20.

Tests

tests:
  - text: <code>sum</code> should equal <code>20</code>
    testString: assert(sum === 20, '<code>sum</code> should equal <code>20</code>');
  - text: Use the <code>+</code> operator
    testString: assert(/\+/.test(code), 'Use the <code>+</code> operator');

Challenge Seed

var sum = 10 + 0;

After Test

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

Solution

var sum = 10 + 10;