DEV Community

Discussion on: Multiply a string? 🤔

Collapse
peerreynders profile image
peerreynders • Edited
  1. JavaScript is truly object-oriented - you can create "objects" directly without the help of constructor functions or classes. JavaScript doesn't implement class-based object orientation like mainstream OOP languages (which are essentially class-oriented). JavaScript classes are a template for creating objects. (Though in some ways JavaScript is also function-oriented)

  2. Function overloading isn't an OO feature. For example Erlang (a functional language) allows the reuse of a function name as long as the arity (number of accepted arguments) varies. And in C++ you can overload non-member functions so procedural code can use overloaded functions (same name but the parameter type signature varies). Operator overloading tends to be an extension of function overloading.

Thread Thread
adam_cyclones profile image
Adam Crockett Author

OO oporator overloading

Not OOP

dev.to/adam_cyclones/oporator-over...