Frames

Untitled

0
1class Thing {
2 constructor(prop) {
3 this.prop = prop;
4 }
5}
6
7const firstThing = new Thing('first');
8console.assert(firstThing.prop === 'first',
9 'firstThing.prop should be "first"');
10
11const secondThing = new Thing('second');
12console.assert(secondThing.prop === 'second',
13 'secondThing.prop should be "second"');
14
15console.assert(firstThing.constructor.name === secondThing.constructor.name,
16 'they have the same constructor ...');
17
18console.assert(firstThing.constructor.name === 'Thing',
19 '... and the constructor is "Thing"');
20