JavaScript Constructor


JavaScript Constructor Special Function
Constructor | Constructor txt | Constructor js | w3 Constructor
I Love Coding

    // Starter JavaScript Constructor

    // Defining a Constructor 
    // 1. Inventory Item Master = iim
    // 2. As Purchased Quantity = (APQ)
    // 3. Edible Portion = (EP)
    function InventoryItemMaster (itemNumber, 
    name, 
    pack, 
    category1, 
    category2, 
    category3, 
    grade, 
    priceLb, 
    priceEach, 
    vendor, 
    location, 
    description) {
      this.itemNumber = itemNumber;
      this.name = name;
      this.pack = pack;
      this.category1 = category1;
      this.category2 = category2;
      this.category3 = category3;
      this.grade = grade;
      this.priceLb = priceLb;
      this.priceEach = priceEach;
      this.vendor = vendor;
      this.location = location;
      this.description = description;
        
    }
    
    // Using a Constructor iim = InventoryItemMaster
    const iim1 = new InventoryItemMaster('123456789', 
    'new york steak 6 oz', 
    '12 pcs 6 oz', 
    'meat', 
    'beef', 
    'pre cut pre portioned', 
    'choice', 
    '$5.99', 
    '$3.49', 
    'allen brothers', 
    'refer 19', 
    '6 oz choice pre cut new york steak')
    // JavaScript Console Log => cl;1
    console.table(iim1);
  

Next Steps: Constructor to HTML Table and New InventoryItemMaster

A.

B.

C.

D.

E.

F.

G.





Last Updated:

Saturday December 04 2021 1000 AM