Bhaiya,
we have seen a couple of ways for oops in javascript (declaring class and objects). Which is the most preferred way.
ex1: function fruit(taste,color){this.taste=taste;this.color=color;}
ex2:- class fruit{ fruit(taste,color){ this.taste=taste;this.color=color;} }
Which one of these is the correct or better way.