Is it possible to create variable/object, which returns string and function at the same time?
> a
'Hello World'
> a()
2018-07-13T13:45:10.967Z
I've seen article about default methods of JavaScript objects, but I couldn't find it now.
I think it should be something like:
// Pseudo code
const a = {
toString: "Hello World",
function: () => new Date(),
};