Question: Need help with this - Write a function called productOfValues which takes in an object of key/value pairs and multiplies the values together. You can

Need help with this -

Write a function called productOfValues which takes in an object of key/value pairs and multiplies the values together.

You can assume that all keys are strings and all values are integers. For example: let testObject = { 'a': 5, 'b': 12, 'c': 3 } productOfValues(testObject) // should return 180 because 5 * 12 * 3 = 180

Unfortunately the answer posted on Chegg - https://www.chegg.com/homework-help/questions-and-answers/write-function-called-productofvalues-takes-object-key-value-pairs-multiplies-values-toget-q44025536?trackid=87722525377f&strackid=bcba9840ba3c displays as incorrect when I run it in the Rep.l.

I get this error message from the above solution. ReferenceError: object is not defined at productOfValues:4:14 at eval:28:13

Thank u. Please advise.

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!