TypeScript | How to return another class from Promise.then() [closed]

Solution 1:

To have an object to return a string value, use the magic __toString method

public function __toString()
{
    return $this->var;
}