freeCodeCamp/curriculum/challenges/russian/02-javascript-algorithms-an.../basic-javascript/add-two-numbers-with-javasc...

60 lines
1.5 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

---
id: cf1111c1c11feddfaeb3bdef
title: Add Two Numbers with JavaScript
challengeType: 1
videoUrl: ''
localeTitle: Сложить два числа с JavaScript
---
## Description
<section id="description"> <code>Number</code> - это тип данных в JavaScript, который представляет числовые данные. Теперь попробуем добавить два числа, используя JavaScript. JavaScript использует символ <code>+</code> в качестве операции сложения при размещении между двумя числами. <strong>пример</strong> <blockquote> myVar = 5 + 10; // присвоено 15 </blockquote></section>
## Instructions
<section id="instructions"> Измените <code>0</code> так, чтобы сумма равнялась <code>20</code> . </section>
## Tests
<section id='tests'>
```yml
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");'
```
</section>
## Challenge Seed
<section id='challengeSeed'>
<div id='js-seed'>
```js
var sum = 10 + 0;
```
</div>
### After Test
<div id='js-teardown'>
```js
console.info('after the test');
```
</div>
</section>
## Solution
<section id='solution'>
```js
// solution required
```
</section>