Robinhood Interview Question

Build a promise function in Vanilla JS.