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
Copy file name to clipboardExpand all lines: lib/node_modules/@stdlib/function/ctor/README.md
+112Lines changed: 112 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -53,6 +53,118 @@ var v = greet( 'Jane' );
53
53
54
54
Argument names must be strings corresponding to valid JavaScript parameters (i.e., a plain identifier, or, in environments supporting such parameters, a rest parameter or destructured parameter, optionally with a default).
55
55
56
+
* * *
57
+
58
+
### Properties
59
+
60
+
<aname="prop-length"></a>
61
+
62
+
#### Function.prototype.length
63
+
64
+
A number representing the number of arguments expected by the function.
65
+
66
+
```javascript
67
+
var greet =newFunction( 'name', 'return "Hello, "+name+"!"' );
68
+
var v =greet.length;
69
+
// returns 1
70
+
```
71
+
72
+
<aname="prop-name"></a>
73
+
74
+
#### Function.prototype.name
75
+
76
+
**Read-only** property representing the name of the function.
77
+
78
+
```javascript
79
+
functiongreet( name ) {
80
+
return'Hello, '+name+'!';
81
+
}
82
+
v =greet.name;
83
+
// returns 'greet'
84
+
85
+
// Functions created with the Function constructor are anonymous:
86
+
var fcn =newFunction( 'name', 'return "Hello, "+name+"!"' );
87
+
var v =fcn.name;
88
+
// returns 'anonymous'
89
+
```
90
+
91
+
<aname="prop-prototype"></a>
92
+
93
+
#### Function.prototype.prototype
94
+
95
+
**Read-only** property representing the prototype of the function.
96
+
97
+
```javascript
98
+
functiongreet( name ) {
99
+
return'Hello, '+name+'!';
100
+
}
101
+
var proto =greet.prototype;
102
+
// returns {}
103
+
```
104
+
105
+
* * *
106
+
107
+
### Methods
108
+
109
+
<aname="method-apply"></a>
110
+
111
+
#### Function.prototype.apply( thisArg, args )
112
+
113
+
Calls the specified function witht he given `this` argument and arguments provided as an array-like object.
0 commit comments