gpt-3.5-turbo-0613· OpenAI
WildChat-4.8M (AI2)
js: need to create a constructor for Laptop with properties (Manufacture, memory,…
- User
js: need to create a constructor for Laptop with properties (Manufacture, memory, capacity, display). create 2 objects
- Assistant
Sure, here's an example of creating a constructor for the Laptop with the specified properties:
function Laptop(manufacture, memory, capacity, display) { this.manufacture = manufacture; this.memory = memory; this.capacity = capacity; this.display = display; } // Creating two Laptop objects var laptop1 = new Laptop("Dell", "8GB", "1TB", "15 inches"); var laptop2 = new Laptop("HP", "16GB", "512GB", "13 inches");