feat(exercise.js): improved performance and variable declaration.