Array Mapping

Need to remove this once I get code working and moved to Google Scripts

by WizKid81

JavaScript

var ingredientList = ["117Prototype:1", "034:1", "108:1"];

var ingredients = ingredientList.map(function(currentIngredient, currentIndex){
          var ingredientArray = currentIngredient.split(":");
          
          var ingredientObject = {id: ingredientArray[0], quantity: ingredientArray[1]};
          
          return ingredientObject;
        });
        
//console.log(ingredients);

var arrayitem = [1,2,3];
var string = "1,2,3";

console.log(arrayitem.hasOwnProperty("map"));
console.log(arrayitem.prototype);
//console.log(arrayitem.prototype.hasOwnProperty("map"));