From 8b5ef8cfdda827ac3905405c4959dc6eeadda507 Mon Sep 17 00:00:00 2001 From: Justin Hilliard Date: Tue, 26 Mar 2019 12:53:19 -0400 Subject: [PATCH] Fix(Curriculum): Constructor function not explained before ES6 #17865 (#35463) * Fix(Curriculum): Constructor function not explained before ES6 #17865 * Update curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/use-class-syntax-to-define-a-constructor-function.english.md Co-Authored-By: hilliarj * Update to #17865 PR Fix(Curriculum): Constructor function not explained before ES6. Used an unordered list and the syntax that others recommended. --- ...-class-syntax-to-define-a-constructor-function.english.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/use-class-syntax-to-define-a-constructor-function.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/use-class-syntax-to-define-a-constructor-function.english.md index 3b71ac300c..52262d78fb 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/use-class-syntax-to-define-a-constructor-function.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/use-class-syntax-to-define-a-constructor-function.english.md @@ -13,8 +13,9 @@ In ES5, we usually define a constructor function, and use the new k The class syntax simply replaces the constructor function creation:
class SpaceShuttle {
  constructor(targetPlanet){
    this.targetPlanet = targetPlanet;
  }
}
const zeus = new SpaceShuttle('Jupiter');
Notice that the class keyword declares a new function, and a constructor was added, which would be invoked when new is called - to create a new object.
-Note
-UpperCamelCase should be used by convention for ES6 class names, as in SpaceShuttle used above. +Notes:
## Instructions