Wix interview question

implement a JS API