From adc82c7587ec3196bba0a332e54ff88ccf4eb7d0 Mon Sep 17 00:00:00 2001 From: Pablo Lucero Date: Thu, 5 Sep 2019 10:29:10 -0300 Subject: [PATCH] fix code examples - remove unnecessary dot - class instantiation: change myComputer to Computer --- javascript/design_patterns/constructorPattern.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/javascript/design_patterns/constructorPattern.md b/javascript/design_patterns/constructorPattern.md index a73a8cf..d0036d5 100644 --- a/javascript/design_patterns/constructorPattern.md +++ b/javascript/design_patterns/constructorPattern.md @@ -15,7 +15,7 @@ function Computer(model, size, age, price){ this.price = price; this.toString = function(){ - return "My computer is a " + this.model + ", is " + this.size + " big, " + this.age + " old and cost me $" + this.price. + return "My computer is a " + this.model + ", is " + this.size + " big, " + this.age + " old and cost me $" + this.price } } @@ -46,8 +46,8 @@ Computer.prototype.toString = function(){ //Usage -var mac = new myComputer("Mac", "15inch", "2 years", 1000); -var pc = new myComputer("Chromebook", "13inch", "1 year", 500); +var mac = new Computer("Mac", "15inch", "2 years", 1000); +var pc = new Computer("Chromebook", "13inch", "1 year", 500); console.log(mac.toString()); console.log(pc.toString());