Domanda di colloquio di Cognizant

Explain Javascript classes (are they actually classes?).

Risposta di colloquio

Anonimo

27 feb 2018

This is an ES6 concept, they aren't actually classes but instead another word that is used to declare a constructor and prototype/static methods associated with it. It could also be used to create an object with methods but no constructor, although that is better done through a module export.