This repository was archived by the owner on Aug 17, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Function
paige edited this page Sep 20, 2023
·
4 revisions
Function is used to create new functions for your class
const Class = require('aepl');
// creates a new class named Example
new Class("Example", class {
constructor() {
this.data = [1, 2, 3];
}
});
// creates a new function for the Example class
new Example.Function("add", function(number) {
return this.data.push(number);
});
// creates a new instance of the class
let example = new Example();
console.log(example.data); // [1, 2, 3]
example.add(4);
console.log(example.data); // [1, 2, 3, 4]description: creates a new function
calls:
- Function/function
- Func/func
parameters:
- name
String: name of the function- value
Any: what the function does (usually a function but can be a normal value)new Class("Example", class { /* class info */ }); new Example.Function("a", function() { /* function info */ }); new Example.Function("b", "value"); let example = new Example(); example.a(); // runs whatever's in the function example.b(); // returns "value"
If you want to check out the different versions and changes check out the releases
For a look into the development side check out the src folder
init()
from()
inspect()
new()
addClass()
addFunc()
addProp()
addChore()
addAsyncChore()
addPreClass()
addPreFunc()
addPreProp()
addPreChore()
addPreAChore()
setName()
setInspect()
Subclass
Function
Property
Chore
AsyncChore
Preclass
PreFunction
PreProperty
PreChore
PreAsyncChore
compact
multiple-layers
event handler
alternate names
setting and getting inspects