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: 1444
Joined: 13 Aug 2016, 21:04
Contact:

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

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: 9583
Joined: 30 Sep 2013, 04:07
Contact:

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

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?

Return to “Ask for Help (v2)”

Who is online

Users browsing this forum: Archimede, FanaticGuru, Google [Bot], shnxx, songdg and 28 guests