How it works...

The static keyword means that the function will be a property of the Rocket class, rather than an instance. This is the same as setting a function property directly on a function, rather than on its prototype. Thus, we call the function as a property of the class, not an instance.

 

Get ECMAScript Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.