Please enable JavaScript to use CodeHS

Exercise : Like Totally Awesome

4 points

Practice
Like Totally Awesome


    


        
(function() { var testResults = []; %StudentCode% // student code %SolutionCode% // solution code function assertEquals(test, studentOutput, solutionOutput, passMsg, failMsg, isHiddenTest) { // Deep compare the results with underscore. var success = _.isEqual(studentOutput, solutionOutput); var message = success ? passMsg : failMsg; testResults.push({ message:message, // Stringify to get pretty printed objects and arrays. solutionOutput: JSON.stringify(solutionOutput), studentOutput: JSON.stringify(studentOutput), success: success, test:test, isHiddenTest: isHiddenTest }); } %TestCases% return testResults; })();