[JS] Added the challenge function