Categories
Mastering Development

How to return function value only by calling constructor [closed]

So my javascript class looks like this: class Teams { get myteams() { return [ ‘Man utd’, ‘Barcelona’ ] } constructor(){ return this } } console.log(Array.from(new Teams()).join(‘,’)); Without chanving the constructor, how can I print the content of the array in the function "myteams"? Note that the constructor has to remain untouched. Also, I cannot […]