'use strict';

const productFromCSV = (productString) => {
  const productArray = productString.split(', ');

  const name = productArray[0];
  const category = productArray[1];
  const price = productArray[2];

  return {
    name: name,
    category: category,
    price: price,
  };
};

const product = productFromCSV('Backpack of Holding, Travel, 29.99');
console.dir(product);
