Merge branch 'master' of github.com:javascript-tutorial/en.javascript.info

This commit is contained in:
Ilya Kantor 2021-01-13 20:01:23 +03:00
commit 4307531f03
3 changed files with 11 additions and 1 deletions

View file

@ -16,6 +16,11 @@ describe("calculator", function() {
prompt.restore();
});
it('the read get two values and saves them as object properties', function () {
assert.equal(calculator.a, 2);
assert.equal(calculator.b, 3);
});
it("the sum is 5", function() {
assert.equal(calculator.sum(), 5);
});

View file

@ -11,6 +11,11 @@ describe("calculator", function() {
calculator.read();
});
it("the read method asks for two values using prompt and remembers them in object properties", function() {
assert.equal(calculator.a, 2);
assert.equal(calculator.b, 3);
});
it("when 2 and 3 are entered, the sum is 5", function() {
assert.equal(calculator.sum(), 5);
});

View file

@ -160,7 +160,7 @@ let [name1, name2] = ["Julius", "Caesar", "Consul", "of the Roman Republic"];
alert(name1); // Julius
alert(name2); // Caesar
// Furher items aren't assigned anywhere
// Further items aren't assigned anywhere
```
If we'd like also to gather all that follows -- we can add one more parameter that gets "the rest" using three dots `"..."`: