From 831675881891b880e62035e2ff195661f83c179b Mon Sep 17 00:00:00 2001 From: Matt Huntington Date: Sun, 6 May 2018 18:16:05 -0400 Subject: [PATCH] fixing crockford --- modular_js/modules.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modular_js/modules.md b/modular_js/modules.md index 336e81f..c3e26d4 100644 --- a/modular_js/modules.md +++ b/modular_js/modules.md @@ -3,7 +3,7 @@ ## Douglas Crockford Style ```javascript -const Car = (name) => { +const Car = function(name){ //private vars let gas = 100; const self = {} @@ -27,7 +27,7 @@ const Car = (name) => { return self; }; -const myCar = Car("Awesome Car"); +const myCar = new Car("Awesome Car"); console.log(myCar.getGasLevel()) myCar.drive(10) console.log(myCar.getGasLevel())