BioCatch interview question

Implement some functions in javascript