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

How can I write a for-in loop to get all values that'll

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!