You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -245,7 +244,7 @@ Returns a boolean indicating whether an object has a property with the specified
245
244
246
245
```javascript
247
246
var o = { 'a':1 };
248
-
Object.hasOwn( o, 'b' );
247
+
var b =Object.hasOwn( o, 'b' );
249
248
// returns false
250
249
```
251
250
@@ -257,7 +256,7 @@ Returns a boolean indicating whether an object has a property with the specified
257
256
258
257
```javascript
259
258
var o = { 'a':1 };
260
-
o.hasOwnProperty( 'a' );
259
+
var b =o.hasOwnProperty( 'a' );
261
260
// returns true
262
261
```
263
262
@@ -268,10 +267,10 @@ o.hasOwnProperty( 'a' );
268
267
Returns a boolean indicating whether two values are the same value.
269
268
270
269
```javascript
271
-
Object.is( 1, 1 );
270
+
var b =Object.is( 1, 1 );
272
271
// returns true
273
272
274
-
Object.is( 1, '1' );
273
+
b =Object.is( 1, '1' );
275
274
// returns false
276
275
```
277
276
@@ -283,11 +282,11 @@ Returns a boolean indicating whether an object is extensible (whether new proper
283
282
284
283
```javascript
285
284
var o = { 'a':1 };
286
-
Object.isExtensible( o );
285
+
var b =Object.isExtensible( o );
287
286
// returns true
288
287
289
288
Object.preventExtensions( o );
290
-
Object.isExtensible( o );
289
+
b =Object.isExtensible( o );
291
290
// returns false
292
291
```
293
292
@@ -299,11 +298,11 @@ Returns a boolean indicating whether an object is frozen. Frozen objects can no
299
298
300
299
```javascript
301
300
var o = { 'a':1 };
302
-
Object.isFrozen( o );
301
+
var b =Object.isFrozen( o );
303
302
// returns false
304
303
305
304
Object.freeze( o );
306
-
Object.isFrozen( o );
305
+
b =Object.isFrozen( o );
307
306
// returns true
308
307
```
309
308
@@ -316,7 +315,7 @@ Returns a boolean indicating whether an object is in the prototype chain of anot
316
315
```javascript
317
316
var o = { 'a':1 };
318
317
var p = { '__proto__': o };
319
-
Object.prototype.isPrototypeOf( p );
318
+
var b =Object.prototype.isPrototypeOf( p );
320
319
// returns true
321
320
```
322
321
@@ -328,11 +327,11 @@ Returns a boolean indicating whether an object is sealed. An object is sealed if
328
327
329
328
```javascript
330
329
var o = { 'a':1 };
331
-
Object.isSealed( o );
330
+
var b =Object.isSealed( o );
332
331
// returns false
333
332
334
333
Object.seal( o );
335
-
Object.isSealed( o );
334
+
b =Object.isSealed( o );
336
335
// returns true
337
336
```
338
337
@@ -345,24 +344,24 @@ Returns an array of a given object's own enumerable property names.
345
344
```javascript
346
345
var o = { 'a':1, 'b':2 };
347
346
var arr =Object.keys( o );
348
-
// returns [ 'a', 'b' ]
347
+
//e.g., returns [ 'a', 'b' ]
349
348
```
350
349
351
350
<aname="static-method-prevent-extensions"></a>
352
351
353
352
#### Object.preventExtensions( o )
354
353
355
-
Returns a boolean indicating whether an object is extensible (whether new properties can be added to it).
354
+
Prevents new properties from being added to an object.
356
355
357
356
```javascript
358
357
var o = { 'a':1 };
359
358
Object.preventExtensions( o );
360
359
o.b=2;
361
-
varbool=o.b===void0;
360
+
varb=( o.b===void0 );
362
361
// returns true
363
362
364
363
o.a=3;
365
-
bool=o.a===3;
364
+
b=( o.a===3 );
366
365
// returns true
367
366
```
368
367
@@ -374,26 +373,26 @@ Returns a boolean indicating whether a property is enumerable.
374
373
375
374
```javascript
376
375
var o = { 'a':1 };
377
-
o.propertyIsEnumerable( 'a' );
376
+
var b =o.propertyIsEnumerable( 'a' );
378
377
// returns true
379
378
380
379
var arr = [ 1, 2, 3 ];
381
-
arr.propertyIsEnumerable( 'length' );
380
+
b =arr.propertyIsEnumerable( 'length' );
382
381
// returns false
383
382
```
384
383
385
384
<aname="static-method-seal"></a>
386
385
387
386
#### Object.seal( o )
388
387
389
-
Returns a boolean indicating whether an object is sealed. An object is sealed if it is not extensible and all of its properties are non-configurable.
388
+
Seals an object, preventing new properties from being added to it (i.e., making it non extensible) and marking all existing properties as non-configurable.
390
389
391
390
```javascript
392
391
var o = { 'a':1 };
393
392
Object.seal( o );
394
393
395
394
o.b=2;
396
-
varbool=o.b===void0
395
+
varb=( o.b===void0 );
397
396
// returns true
398
397
```
399
398
@@ -408,7 +407,7 @@ var o = { 'a': 1 };
408
407
var p = { 'b':2 };
409
408
Object.setPrototypeOf( o, p );
410
409
411
-
varbool=o.b===2;
410
+
varb=( o.b===2 );
412
411
// returns true
413
412
```
414
413
@@ -443,9 +442,9 @@ var str = o.toString();
443
442
Returns the primitive value of the specified object.
444
443
445
444
```javascript
446
-
varnum=newNumber( 1 );
447
-
varval=num.valueOf();
448
-
// returns 1
445
+
varo={};
446
+
varv=o.valueOf();
447
+
// returns {}
449
448
```
450
449
451
450
<aname="static-method-values"></a>
@@ -457,7 +456,7 @@ Returns an array of a given object's own enumerable property values.
0 commit comments