Robinhood interview question

Build a promise function in Vanilla JS.