-2

From what I've read, JavaScript is not a "purely object-oriented" programming language but Python is. And JavaScript uses "prototype based inheritance" while Python uses "class-based inheritance".

JavaScript is the language I learned to code in, so I don't quite understand what they mean by "purely object oriented". And I thought a class is kind of like a prototype of an object, so I don't understand how the two ideas are apparently different.

Karl Knechtel
  • 62,466
  • 11
  • 102
  • 153
black_RAM
  • 11
  • 1
  • Essentially, what that means is that a language has types that are not objects. JS has primitive types, that are not objects, and don't have methods/attributes. In Python, *everything* is an object. Java is another example of a language that is not purely object oriented. Both JS and Java have "boxing" though. – juanpa.arrivillaga Aug 25 '23 at 18:51
  • A class is like a template, not a prototype. Prototypal and class inheritance are different, although, they are both object oriented paradigms. – juanpa.arrivillaga Aug 25 '23 at 18:52

0 Answers0