<blockquote>
<strong>Possible Duplicate:</strong><br>
<a href="https://stackoverflow.com/questions/816071/prototype-based-vs-class-based-inheritance">prototype based vs. class based inheritance</a>
</blockquote>
This question came up at work the other day - what's the difference between a class-based language like Python, and a prototype-based language like Javascript? Aside from differing approches, both ways seem very similar and we struggled to find something that a class-based language could do that a prototype-based language couldn't, or vice-versa.
Can anybody elaborate or go into any detail on how they differ fundamentally?
I haven't found much online about the differences, just sites that show you how to accomplish one with the other (such as this: <a href="http://unspecified.wordpress.com/2011/06/05/simulating-classes-with-prototypes-in-javascript/" rel="nofollow noreferrer">Simulating classes with prototypes in JavaScript</a>)
Any enlightenment appreciated!
<strong>Possible Duplicate:</strong><br>
<a href="https://stackoverflow.com/questions/816071/prototype-based-vs-class-based-inheritance">prototype based vs. class based inheritance</a>
</blockquote>
This question came up at work the other day - what's the difference between a class-based language like Python, and a prototype-based language like Javascript? Aside from differing approches, both ways seem very similar and we struggled to find something that a class-based language could do that a prototype-based language couldn't, or vice-versa.
Can anybody elaborate or go into any detail on how they differ fundamentally?
I haven't found much online about the differences, just sites that show you how to accomplish one with the other (such as this: <a href="http://unspecified.wordpress.com/2011/06/05/simulating-classes-with-prototypes-in-javascript/" rel="nofollow noreferrer">Simulating classes with prototypes in JavaScript</a>)
Any enlightenment appreciated!