I've a function inside an object. When I console.log
the function variable, it's showing the name of function as an empty object instead of the data returned from the function.
Here's My JavaScript Code
var Obj = {
x: function() {
return 'Hello World';
}
}
var data = new Obj.x();
console.log(data);
Current Output
x { }
Expected Output
Hello World