I want to make a function that appends to an array that I can then call by using arrayname.Function()
. However, I have no idea how to do this; can anyone help?
Asked
Active
Viewed 24 times
0

Shadowtail
- 180
- 12
-
your question is not clear at all, please provide a better description – marvel308 Sep 15 '17 at 20:04
-
3Add functions to `Array.prototype` like: `Array.prototype.func = ...`. But bear in mind that this is not recommended. – ibrahim mahrir Sep 15 '17 at 20:05
-
1Take a look here: https://stackoverflow.com/questions/948358/adding-custom-functions-into-array-prototype – Sam Conran Sep 15 '17 at 20:10