Does calling cls.prototype.method() and static cls.method() have the same behavior? Topic is solved

Get help with using AutoHotkey (v2 or newer) and its commands and hotkeys
iseahound
Posts: 1434
Joined: 13 Aug 2016, 21:04
Contact:

Does calling cls.prototype.method() and static cls.method() have the same behavior?

Post by iseahound » 20 Apr 2021, 22:48

Code: Select all

class cls {
   method() {
      MsgBox
   }
}
cls.prototype.method()

Code: Select all

class cls {
   static method() {
      MsgBox
   }
}
cls.method()
Does the static keyword initialize differently? I'm 95% sure they're the same thing but I'd like confirmation. Also properties too.

lexikos
Posts: 9553
Joined: 30 Sep 2013, 04:07
Contact:

Re: Does calling cls.prototype.method() and static cls.method() have the same behavior?  Topic is solved

Post by lexikos » 21 Apr 2021, 22:45

No. Declaring a static method is obviously not the same thing as declaring an instance method.
Exactly what are you asking?

Post Reply

Return to “Ask for Help (v2)”