Skip to content
This repository was archived by the owner on Aug 17, 2025. It is now read-only.

addProp()

paige edited this page Sep 25, 2023 · 6 revisions

addProp() and addProperty() adds a new property

const Class = require('aepl');


new Class("Main", class {
    constructor() {
        this.data = [1, 2, 3];
    }
});


Main.addProp("reversed", function() {
    return this.data.reverse();
});


let main = new Main();

console.log(main.reversed); // [3, 2, 1]

Class.addProp()

description: adds a new property
calls:

  • addProp()
  • addProperty()
  • setProp()
  • setProperty()
  • newProp()
  • newProperty()
  • addP()
  • setP()
  • newP()

Clone this wiki locally