Object Vs Class Javascript