Spot the bug in product labels

from Classes
Node 24 intermediate 4 min 1 issue to find

Find why mapping products throws instead of producing labels.

JavaScript
class PriceList {
  constructor(currency) {
    this.currency = currency;
  }

  label(product) {
    return `${this.currency} ${product.price.toFixed(2)}`;
  }
}

const list = new PriceList('USD');
const products = [{ price: 8 }, { price: 12.5 }];
const labels = products.map(list.label);
console.log(labels);
Open in playground
Report an error