Question: How can I write a for-in loop to get all values that'll be in the object grades and add 10 to any and all values.
How can I write a for-in loop to get all values that'll be in the object grades and add 10 to any and all values.
Written Instructions:
Create a function called curveGrades that increments each value in an Object by 10
- 1 parameter: grades - an Object of subject:grade pairs
- returns: the grades object after each grade has been incremented by 10
How to create this function:
- Use a for-in loop to iterate over grades
- Use Bracket Notation to increment the value of each grade by 10 using
+= 10; - After the loop return grades

passes: 2 failures: 1 duration: 0.02s 100% 1 function curveGrades (grades) { 2 // YOUR CODE BELOW HERE // 3 for (var i in grades) { curve Grades() should exist X should increment each value in the input object by 10 5 6 7 } i = grades.value; grades[i] += 10; AssertionError: expected { a: 10, b: 20, c: 30, undefined: NaN } to deeply equal { a: 20, b: 30, C: 40 } 9 10 11 } return grades; // YOUR CODE ABOVE HERE // should return the original grades object Run Submit Auto-Run OFF Reset
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
