What would be the output of the following code snippet? [ES6 Classes]
@Yomesh Gupta
function parseData(data) {
/* Some computation */
return data;
};
class User {
constructor(name, ...data) {
const parsedData = parseData(data);
this.name = name;
this.data = parseData;
return parsedData;
}
getData() {
return this.data;
}
}
const Yomesh = new User('Yomesh', {
youtubeChannel: 'https://bit.ly/devtools-yt',
shouldSubscribe: true
});
// What would be the output of the following statement?
console.log(Yomesh.getData());
Option 1
{ youtubeChannel: 'https://bit.ly/devtools-yt', shouldSubscribe: true }
Option 2
undefined
Option 3
Error
Option 4
null
Option 5
[object Object]