Skip to content

Commit d14f030

Browse files
doc: update examples to use class syntax for Foo and Bar
1 parent dc0c5bc commit d14f030

File tree

2 files changed

+20
-4
lines changed

2 files changed

+20
-4
lines changed

doc/api/assert.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,9 +272,17 @@ strictEqual({ a: 1 }, { b: { c: 1 } });
272272
The `skipPrototypeComparison` option affects all deep equality methods:
273273

274274
```js
275-
function Foo(a) { this.a = a; }
275+
class Foo {
276+
constructor(a) {
277+
this.a = a;
278+
}
279+
}
276280

277-
function Bar(a) { this.a = a; }
281+
class Bar {
282+
constructor(a) {
283+
this.a = a;
284+
}
285+
}
278286

279287
const foo = new Foo(1);
280288
const bar = new Bar(1);

doc/api/util.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1581,9 +1581,17 @@ enumerable properties are deeply strictly equal.
15811581
```js
15821582
const util = require('node:util');
15831583

1584-
function Foo(a) { this.a = a; }
1584+
class Foo {
1585+
constructor(a) {
1586+
this.a = a;
1587+
}
1588+
}
15851589

1586-
function Bar(a) { this.a = a; }
1590+
class Bar {
1591+
constructor(a) {
1592+
this.a = a;
1593+
}
1594+
}
15871595

15881596
const foo = new Foo(1);
15891597
const bar = new Bar(1);

0 commit comments

Comments
 (0)