* fix: rm assert msg basic-javascript * fix: removed more assert msg args * fix: fixed verbiage Co-Authored-By: Parth Parth <34807532+thecodingaviator@users.noreply.github.com>
1.1 KiB
1.1 KiB
id, title, challengeType, videoUrl
id | title | challengeType | videoUrl |
---|---|---|---|
cf1111c1c11feddfaeb3bdef | Add Two Numbers with JavaScript | 1 | https://scrimba.com/c/cM2KBAG |
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 an addition operator when placed between two numbers.
Example:
myVar = 5 + 10; // assigned 15
Instructions
0
so that sum will equal 20
.
Tests
tests:
- text: <code>sum</code> should equal <code>20</code>
testString: assert(sum === 20);
- text: Use the <code>+</code> operator
testString: assert(/\+/.test(code));
Challenge Seed
var sum = 10 + 0;
After Test
(function(z){return 'sum = '+z;})(sum);
Solution
var sum = 10 + 10;