Skip to content

Commit 4307531

Browse files
committed
Merge branch 'master' of github.com:javascript-tutorial/en.javascript.info
2 parents bc8b37b + f6d3e30 commit 4307531

File tree

3 files changed

+11
-1
lines changed
  • 1-js
    • 04-object-basics
      • 04-object-methods/7-calculator/_js.view
      • 06-constructor-new/2-calculator-constructor/_js.view
    • 05-data-types/10-destructuring-assignment

3 files changed

+11
-1
lines changed

1-js/04-object-basics/04-object-methods/7-calculator/_js.view/test.js

+5
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ describe("calculator", function() {
1515
afterEach(function() {
1616
prompt.restore();
1717
});
18+
19+
it('the read get two values and saves them as object properties', function () {
20+
assert.equal(calculator.a, 2);
21+
assert.equal(calculator.b, 3);
22+
});
1823

1924
it("the sum is 5", function() {
2025
assert.equal(calculator.sum(), 5);

1-js/04-object-basics/06-constructor-new/2-calculator-constructor/_js.view/test.js

+5
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ describe("calculator", function() {
1010
calculator = new Calculator();
1111
calculator.read();
1212
});
13+
14+
it("the read method asks for two values using prompt and remembers them in object properties", function() {
15+
assert.equal(calculator.a, 2);
16+
assert.equal(calculator.b, 3);
17+
});
1318

1419
it("when 2 and 3 are entered, the sum is 5", function() {
1520
assert.equal(calculator.sum(), 5);

1-js/05-data-types/10-destructuring-assignment/article.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ let [name1, name2] = ["Julius", "Caesar", "Consul", "of the Roman Republic"];
160160

161161
alert(name1); // Julius
162162
alert(name2); // Caesar
163-
// Furher items aren't assigned anywhere
163+
// Further items aren't assigned anywhere
164164
```
165165

166166
If we'd like also to gather all that follows -- we can add one more parameter that gets "the rest" using three dots `"..."`:

0 commit comments

Comments
 (0)