You are given an array of strings consisting of grocery items, with prices in parentheses. Return an array of prices in float format.
getPrices(["ice cream ($5.99)", "banana ($0.20)", "sandwich ($8.50)", "soup ($1.99)"]) ➞ [5.99, 0.2, 8.50, 1.99]
getPrices(["salad ($4.99)"]) ➞ [4.99]
See if you can use RegExp to solve (but it's not necessary).