A test got the body of an API response as a JSON string. The product is in the field data.product. Write a function getProduct(body) that returns an object with only the name and price of that product.
getProduct('{"status":200,"data":{"product":{"id":7,"name":"Phone","price":300}}}')Returns { name: 'Phone', price: 300 }
getProduct('{"status":200,"data":{"product":{"id":7,"name":"Phone","price":300}}}'){ name: 'Phone', price: 300 }getProduct('{"status":200,"data":{"product":{"id":12,"name":"Laptop","price":1500,"stock":4}}}'){ name: 'Laptop', price: 1500 }Hidden tests run on Submit.