← Back to challenges

Multiplying Numbers in a String

JavaScriptHardlanguage_fundamentalsnumbersstrings

Instructions

Given a string of numbers separated by a comma and space, return the product of the numbers.

Examples

multiplyNums("2, 3") ➞ 6

multiplyNums("1, 2, 3, 4") ➞ 24

multiplyNums("54, 75, 453, 0") ➞ 0

multiplyNums("10, -2") ➞ -20

Notes

Bonus: Try to complete this challenge in one line!

javascript
Loading editor…
to run
Walks through the solution with reasoning and edge cases.
Next: Is Johnny Making Progress?