scip exercise in javascript