Skip to content

Prototype.new()

github-actions[bot] edited this page Aug 26, 2024 · 1 revision

creates a new Prototype

Lua
localPrototype=require("classjs")("Prototype");
localExample=Prototype.new("Example", {
constructor=function(self, name)
self.Name=name;
end,
Test=function(self)
returnstring.lower(self.Name) end,
Type=1
});
print(Example); -- [class Example]

Type:

  • Function

Returns:

Sources:

Arguments:

  • nameString
    name of the class

  • prototableTable
    prototype data used for the class's properties




classjs docs


Keywords

🛈 class

🛈 extend

🛈 new

Methods

🛈 isa()

🛈 getclass()

🛈 Prototype

🛈 new()

🛈 __isa()

🛈 __super()

🛈 __name

🛈 __instances

🛈 __prototype

🛈 __extendee

🛈 __class

🛈 PrototypeItem

🛈 new()

🛈 __value

🛈 __parent

🛈 __writable

🛈 __configurable

🛈 __enumerable

🛈 Object

🛈 defineProperties()

🛈 defineProperty()

🛈 entries()

🛈 getOwnPropertyDescriptor()

🛈 getOwnPropertyDescriptors()

🛈 keys()

🛈 values()


Clone this wiki locally