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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started