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:
https://developer.mozilla.org/en-US/d...
Support me on Patreon:
/ 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!