JavaScript Classes #3: Static Methods - JavaScript OOP Tutorial

dcode
dcode
35.5 هزار بار بازدید - 6 سال پیش - In JavaScript you can define
In JavaScript you can define "static methods" or "static functions" which are functions that are defined on a class but do not actually require an instance of that class to be created. In most cases, static methods are "helper methods" or used for creating instances of that class. In this video I take you through a simple example of how you can define static methods on a class - we create a method used to compare two instances to give a result. For your reference, check this out: developer.mozilla.org/en-US/docs/Web/JavaScript/Re… Support me on Patreon: patreon.com/dcode Follow me on Twitter @dcode! If this video helped you out and you'd like to see more, make sure to leave a like and subscribe to dcode!
6 سال پیش در تاریخ 1397/03/11 منتشر شده است.
35,522 بـار بازدید شده
... بیشتر