Skip to content

Commit fe56462

Browse files
committed
Fix typos, descriptions, and example code
1 parent fdfdcf4 commit fe56462

File tree

2 files changed

+33
-34
lines changed

2 files changed

+33
-34
lines changed

lib/node_modules/@stdlib/function/ctor/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,12 @@ var v = greet.length;
7979
function greet( name ) {
8080
return 'Hello, '+name+'!';
8181
}
82-
v = greet.name;
82+
var v = greet.name;
8383
// returns 'greet'
8484

8585
// Functions created with the Function constructor are anonymous:
8686
var fcn = new Function( 'name', 'return "Hello, "+name+"!"' );
87-
var v = fcn.name;
87+
v = fcn.name;
8888
// returns 'anonymous'
8989
```
9090

@@ -110,7 +110,7 @@ var proto = greet.prototype;
110110

111111
#### Function.prototype.apply( thisArg, args )
112112

113-
Calls the specified function witht he given `this` argument and arguments provided as an array-like object.
113+
Calls the specified function with the given `this` argument and arguments provided as an array-like object.
114114

115115
```javascript
116116
function add( x, y ) {
@@ -127,7 +127,7 @@ var v = add.apply( null, [ 1, 2 ] );
127127
Returns a new function which invokes the original function with the given `this` value and arguments.
128128

129129
```javascript
130-
functiona add( x, y ) {
130+
function add( x, y ) {
131131
return x + y;
132132
}
133133
var add1 = add.bind( null, 1 );
@@ -162,7 +162,7 @@ function add( x, y ) {
162162
return x + y;
163163
}
164164
var v = add.toString();
165-
// returns 'function add( x, y ) {\n return x + y;\n}'
165+
// e.g., returns 'function add( x, y ) {\n return x + y;\n}'
166166
```
167167

168168
</section>

lib/node_modules/@stdlib/object/ctor/README.md

Lines changed: 28 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,7 @@ var o = Object.defineProperties( {}, {
138138
Defines a new property directly on an object, or modifies an existing property on an object, and returns the object.
139139

140140
```javascript
141-
var o = {};
142-
Object.defineProperty( o, 'a', {
141+
var o = Object.defineProperty( {}, 'a', {
143142
'value': 1,
144143
'writable': true,
145144
'enumerable': true,
@@ -157,7 +156,7 @@ Returns an array of a given object's own enumerable string-keyed property entrie
157156
```javascript
158157
var o = { 'a': 1, 'b': 2 };
159158
var arr = Object.entries( o );
160-
// returns [ [ 'a', 1 ], [ 'b', 2 ] ]
159+
// e.g., returns [ [ 'a', 1 ], [ 'b', 2 ] ]
161160
```
162161

163162
<a name="static-method-freeze"></a>
@@ -172,7 +171,7 @@ Object.freeze( o );
172171
// returns { 'a': 1 }
173172

174173
o.b = 1;
175-
o.b
174+
var v = o.b;
176175
// returns undefined
177176
```
178177

@@ -209,7 +208,7 @@ Returns an array of a given object's own property names.
209208
```javascript
210209
var o = { 'a': 1, 'b': 2 };
211210
var arr = Object.getOwnPropertyNames( o );
212-
// returns [ 'a', 'b' ]
211+
// e.g., returns [ 'a', 'b' ]
213212
```
214213

215214
<a name="static-method-get-own-property-symbols"></a>
@@ -245,7 +244,7 @@ Returns a boolean indicating whether an object has a property with the specified
245244

246245
```javascript
247246
var o = { 'a': 1 };
248-
Object.hasOwn( o, 'b' );
247+
var b = Object.hasOwn( o, 'b' );
249248
// returns false
250249
```
251250

@@ -257,7 +256,7 @@ Returns a boolean indicating whether an object has a property with the specified
257256

258257
```javascript
259258
var o = { 'a': 1 };
260-
o.hasOwnProperty( 'a' );
259+
var b = o.hasOwnProperty( 'a' );
261260
// returns true
262261
```
263262

@@ -268,10 +267,10 @@ o.hasOwnProperty( 'a' );
268267
Returns a boolean indicating whether two values are the same value.
269268

270269
```javascript
271-
Object.is( 1, 1 );
270+
var b = Object.is( 1, 1 );
272271
// returns true
273272

274-
Object.is( 1, '1' );
273+
b = Object.is( 1, '1' );
275274
// returns false
276275
```
277276

@@ -283,11 +282,11 @@ Returns a boolean indicating whether an object is extensible (whether new proper
283282

284283
```javascript
285284
var o = { 'a': 1 };
286-
Object.isExtensible( o );
285+
var b = Object.isExtensible( o );
287286
// returns true
288287

289288
Object.preventExtensions( o );
290-
Object.isExtensible( o );
289+
b = Object.isExtensible( o );
291290
// returns false
292291
```
293292

@@ -299,11 +298,11 @@ Returns a boolean indicating whether an object is frozen. Frozen objects can no
299298

300299
```javascript
301300
var o = { 'a': 1 };
302-
Object.isFrozen( o );
301+
var b = Object.isFrozen( o );
303302
// returns false
304303

305304
Object.freeze( o );
306-
Object.isFrozen( o );
305+
b = Object.isFrozen( o );
307306
// returns true
308307
```
309308

@@ -316,7 +315,7 @@ Returns a boolean indicating whether an object is in the prototype chain of anot
316315
```javascript
317316
var o = { 'a': 1 };
318317
var p = { '__proto__': o };
319-
Object.prototype.isPrototypeOf( p );
318+
var b = Object.prototype.isPrototypeOf( p );
320319
// returns true
321320
```
322321

@@ -328,11 +327,11 @@ Returns a boolean indicating whether an object is sealed. An object is sealed if
328327

329328
```javascript
330329
var o = { 'a': 1 };
331-
Object.isSealed( o );
330+
var b = Object.isSealed( o );
332331
// returns false
333332

334333
Object.seal( o );
335-
Object.isSealed( o );
334+
b = Object.isSealed( o );
336335
// returns true
337336
```
338337

@@ -345,24 +344,24 @@ Returns an array of a given object's own enumerable property names.
345344
```javascript
346345
var o = { 'a': 1, 'b': 2 };
347346
var arr = Object.keys( o );
348-
// returns [ 'a', 'b' ]
347+
// e.g., returns [ 'a', 'b' ]
349348
```
350349

351350
<a name="static-method-prevent-extensions"></a>
352351

353352
#### Object.preventExtensions( o )
354353

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.
356355

357356
```javascript
358357
var o = { 'a': 1 };
359358
Object.preventExtensions( o );
360359
o.b = 2;
361-
var bool = o.b === void 0;
360+
var b = ( o.b === void 0 );
362361
// returns true
363362

364363
o.a = 3;
365-
bool = o.a === 3;
364+
b = ( o.a === 3 );
366365
// returns true
367366
```
368367

@@ -374,26 +373,26 @@ Returns a boolean indicating whether a property is enumerable.
374373

375374
```javascript
376375
var o = { 'a': 1 };
377-
o.propertyIsEnumerable( 'a' );
376+
var b = o.propertyIsEnumerable( 'a' );
378377
// returns true
379378

380379
var arr = [ 1, 2, 3 ];
381-
arr.propertyIsEnumerable( 'length' );
380+
b = arr.propertyIsEnumerable( 'length' );
382381
// returns false
383382
```
384383

385384
<a name="static-method-seal"></a>
386385

387386
#### Object.seal( o )
388387

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.
390389

391390
```javascript
392391
var o = { 'a': 1 };
393392
Object.seal( o );
394393

395394
o.b = 2;
396-
var bool = o.b === void 0
395+
var b = ( o.b === void 0 );
397396
// returns true
398397
```
399398

@@ -408,7 +407,7 @@ var o = { 'a': 1 };
408407
var p = { 'b': 2 };
409408
Object.setPrototypeOf( o, p );
410409

411-
var bool = o.b === 2;
410+
var b = ( o.b === 2 );
412411
// returns true
413412
```
414413

@@ -443,9 +442,9 @@ var str = o.toString();
443442
Returns the primitive value of the specified object.
444443

445444
```javascript
446-
var num = new Number( 1 );
447-
var val = num.valueOf();
448-
// returns 1
445+
var o = {};
446+
var v = o.valueOf();
447+
// returns {}
449448
```
450449

451450
<a name="static-method-values"></a>
@@ -457,7 +456,7 @@ Returns an array of a given object's own enumerable property values.
457456
```javascript
458457
var o = { 'a': 1, 'b': 2 };
459458
var arr = Object.values( o );
460-
// returns [ 1, 2 ]
459+
// e.g., returns [ 1, 2 ]
461460
```
462461

463462
</section>

0 commit comments

Comments
 (0)