From 94f54567790f3c9cb755201411e68069a23378fb Mon Sep 17 00:00:00 2001 From: Jasmine Daniels Date: Mon, 11 Mar 2024 15:31:09 -0400 Subject: [PATCH] created Product class --- classes/Product.js | 14 ++++++++++++++ index.js | 4 +--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/classes/Product.js b/classes/Product.js index e69de29..1761df0 100644 --- a/classes/Product.js +++ b/classes/Product.js @@ -0,0 +1,14 @@ +class Product { + constructor(name, price, description){ + this.name = name; + this.price = price; + this.description = description; + this.inStock = true; + } + + display(){ + return `Name: ${this.name}, Price: $${this.price}, Description: ${this.description}` + } +} + +module.exports = Product; \ No newline at end of file diff --git a/index.js b/index.js index efad601..5eb5f68 100644 --- a/index.js +++ b/index.js @@ -1,7 +1,5 @@ // Import Classes Here - - - +const Product = require('./classes/Product');