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

setName()

paige edited this page Sep 28, 2023 · 2 revisions

the setName function is used to create an alternate name for a class

const Class = require('aepl');


// creates a new class named A
Class.new("A", class {
    constructor() {
        this.data = [1, 2, 3];
    }
});


// creates a new prop called test
A.newProp("test", function() {
    return this.data.reverse();
});


// sets name to B
A.setName("B");


let b = new B();

console.log(b); // A { data: [1, 2, 3] }
console.log(b.test); // [3, 2, 1]



Class.setName()

description: sets the name of a class
parameters:

  • name String: name to set to
  • ?autodefine Boolean: if it should automatically define as the new name

refs:

  • setName()
  • setN()

Clone this wiki locally