// Tip: You can use the Array.isArray function to check whether an item// is a list or an integer.functionproductSum(arr) {returnfindProductSum(arr);}functionfindProductSum(arr, depth =1) {let sum =0;for (constvalueof arr) {if (!Array.isArray(value)) { sum += value;continue; } sum +=findProductSum(value, depth +1); }return sum * depth;}// Do not edit the line below.exports.productSum = productSum;