Skip to content

Commit 2df8572

Browse files
committed
Add repl.txt docs for constructors
1 parent e00ea6d commit 2df8572

3 files changed

Lines changed: 701 additions & 0 deletions

File tree

lib/node_modules/@stdlib/boolean/ctor/docs/repl.txt

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,36 @@
3434
> b = {{alias}}( [] )
3535
true
3636

37+
{{alias}}.prototype.toString()
38+
Returns a string representing the `Boolean` object.
39+
40+
Returns
41+
-------
42+
out: string
43+
String representation.
44+
45+
Examples
46+
--------
47+
> var b = new {{alias}}( true )
48+
<Boolean>
49+
> b.toString()
50+
'true'
51+
52+
{{alias}}.prototype.valueOf()
53+
Returns the primitive value of a `Boolean` object.
54+
55+
Returns
56+
-------
57+
out: boolean
58+
Boolean primitive.
59+
60+
Examples
61+
--------
62+
> var b = new {{alias}}( true )
63+
<Boolean>
64+
> b.valueOf()
65+
true
66+
3767
See Also
3868
--------
3969

lib/node_modules/@stdlib/function/ctor/docs/repl.txt

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,119 @@
2525
> f( 1, 2 )
2626
3
2727

28+
29+
{{alias}}.prototype.apply( thisArg, args )
30+
Calls a function with a given `this` value and arguments provided as an
31+
array (or array-like object).
32+
33+
Parameters
34+
----------
35+
thisArg: any
36+
Value to use as `this` when executing the function.
37+
38+
args: Array
39+
Array of arguments to pass to the function.
40+
41+
Returns
42+
-------
43+
out: any
44+
Function return value.
45+
46+
Examples
47+
--------
48+
> var f = new {{alias}}( 'x', 'y', 'return x + y' );
49+
> f.apply( null, [ 1, 2 ] )
50+
3
51+
52+
{{alias}}.prototype.call( thisArg, ...args )
53+
Calls a function with a given `this` value and arguments provided
54+
individually.
55+
56+
Parameters
57+
----------
58+
thisArg: any
59+
Value to use as `this` when executing the function.
60+
61+
args: ...any
62+
Arguments to pass to the function.
63+
64+
Returns
65+
-------
66+
out: any
67+
Function return value.
68+
69+
Examples
70+
--------
71+
> var f = new {{alias}}( 'x', 'y', 'return x + y' );
72+
> f.call( null, 1, 2 )
73+
3
74+
75+
{{alias}}.prototype.bind( thisArg, ...args )
76+
Creates a new function which, when called, has its `this` keyword set to the
77+
provided value, with a given sequence of arguments preceding any provided
78+
when the new function is called.
79+
80+
Parameters
81+
----------
82+
thisArg: any
83+
Value to use as `this` when executing the function.
84+
85+
args: ...any
86+
Arguments to pass to the function.
87+
88+
Returns
89+
-------
90+
fcn: Function
91+
Bound function.
92+
93+
Examples
94+
--------
95+
> var f = new {{alias}}( 'x', 'y', 'return x + y' );
96+
> var g = f.bind( null, 1 );
97+
> g( 2 )
98+
3
99+
100+
{{alias}}.prototype.toString()
101+
Returns a string representation of the function.
102+
103+
Examples
104+
--------
105+
> var f = new {{alias}}( 'x', 'y', 'return x + y' );
106+
> f.toString()
107+
'function anonymous( x, y ) { return x + y; }'
108+
109+
{{alias}}.prototype.length
110+
The number of arguments expected by the function.
111+
112+
Examples
113+
--------
114+
> var f = new {{alias}}( 'x', 'y', 'return x + y' );
115+
> f.length
116+
2
117+
118+
{{alias}}.prototype.name
119+
The name of the function.
120+
121+
Examples
122+
--------
123+
> var f = new {{alias}}( 'x', 'y', 'return x + y' );
124+
> f.name
125+
'anonymous'
126+
127+
> var f = new {{alias}}( 'x', 'y', 'return x + y' );
128+
> f.name = 'add';
129+
> f.name
130+
'add'
131+
132+
{{alias}}.prototype.prototype
133+
The prototype of the function.
134+
135+
Examples
136+
--------
137+
> var f = new {{alias}}( 'x', 'y', 'return x + y' );
138+
> f.prototype
139+
{}
140+
28141
See Also
29142
--------
30143

0 commit comments

Comments
 (0)