Merge branch 'master' of github.com:javascript-tutorial/en.javascript.info
This commit is contained in:
commit
4307531f03
3 changed files with 11 additions and 1 deletions
|
@ -16,6 +16,11 @@ describe("calculator", function() {
|
||||||
prompt.restore();
|
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() {
|
it("the sum is 5", function() {
|
||||||
assert.equal(calculator.sum(), 5);
|
assert.equal(calculator.sum(), 5);
|
||||||
});
|
});
|
||||||
|
|
|
@ -11,6 +11,11 @@ describe("calculator", function() {
|
||||||
calculator.read();
|
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() {
|
it("when 2 and 3 are entered, the sum is 5", function() {
|
||||||
assert.equal(calculator.sum(), 5);
|
assert.equal(calculator.sum(), 5);
|
||||||
});
|
});
|
||||||
|
|
|
@ -160,7 +160,7 @@ let [name1, name2] = ["Julius", "Caesar", "Consul", "of the Roman Republic"];
|
||||||
|
|
||||||
alert(name1); // Julius
|
alert(name1); // Julius
|
||||||
alert(name2); // Caesar
|
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 `"..."`:
|
If we'd like also to gather all that follows -- we can add one more parameter that gets "the rest" using three dots `"..."`:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue