Bloomberg interview question

Javascript memories function