This is what seems to not be understood by a lot of investors and people commenting on investments. Amazon could have turned a profit years earlier if they wanted to. Instead it made more sense to continue spending all of their money on expansion and R&D.
It's the same with Tesla. They are selling a shit ton of cars at good markup. If they wanted a profit, they could have one. They just don't want one right now.