Then why classes introduced in es6. If we can do composition in JavaScript.
sabareesh k

“JavaScript classes introduced in ECMAScript 2015 are primarily syntactical sugar over JavaScript’s existing prototype-based inheritance. The class syntax is not introducing a new object-oriented inheritance model to JavaScript. JavaScript classes provide a much simpler and clearer syntax to create objects and deal with inheritance.” from Mozilla Dev Network

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.