Objects and classes in JavaScript | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 1

Objects and classes in JavaScript

Hi. I have a question related to JavaScript, are an object and a class the same thing? I understand that they are different syntactically but they do the same thing. Please someone clarify me this doubt. Greetings to all

20th Feb 2024, 11:21 AM
Leonardo Escalona RodrĆ­guez
1 Resposta
+ 3
They are different Objects are instances of data that holds properties and methods. Classes are blueprints for creating objects .It helps create objects with predefined properties and methods. So they may be related but fulfill different purpose.
20th Feb 2024, 11:39 AM
š˜•š˜‰
š˜•š˜‰ - avatar