Skip to content

Commit e919001

Browse files
committed
docs: resolve lint errors
1 parent 80d2493 commit e919001

File tree

1 file changed

+19
-6
lines changed
  • lib/node_modules/@stdlib/function/ctor

1 file changed

+19
-6
lines changed

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

+19-6
Original file line numberDiff line numberDiff line change
@@ -112,12 +112,19 @@ var proto = greet.prototype;
112112

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

115+
<!-- eslint-disable no-invalid-this -->
116+
115117
```javascript
116118
function add( x, y ) {
117-
return x + y;
119+
return this.initial + x + y;
118120
}
119-
var v = add.apply( null, [ 1, 2 ] );
120-
// returns 3
121+
122+
var ctx = {
123+
'initial': 10
124+
};
125+
126+
var v = add.apply( ctx, [ 1, 2 ] );
127+
// returns 13
121128
```
122129

123130
<a name="method-bind"></a>
@@ -142,13 +149,19 @@ var v = add1( 2 );
142149

143150
Calls the specified function with the given `this` value and arguments.
144151

152+
<!-- eslint-disable no-invalid-this -->
153+
145154
```javascript
146155
function add( x, y ) {
147-
return x + y;
156+
return this.initial + x + y;
148157
}
149158

150-
var v = add.call( null, 1, 2 );
151-
// returns 3
159+
var ctx = {
160+
'initial': 10
161+
};
162+
163+
var v = add.call( ctx, 1, 2 );
164+
// returns 13
152165
```
153166

154167
<a name="method-to-string"></a>

0 commit comments

Comments
 (0)