Javascript Classes Explained - Javascript Factory Functions - ES6 Private Variables Properties
Offered By: Dave Gray via YouTube
Course Description
Overview
Syllabus
Classes are "syntactic sugar" in JS
Creating a simple class with a constructor
Using the keyword this
Adding a method to the class
Classes are templates / blueprints for objects
Using the new keyword to create the object
Calling the object's method
Adding parameters to the constructor
Passing multiple parameters to the constructor
Accessing properties with dot notation
getters and setters
A more readable getter and setter method
An array property with a getter and setter
A parent "super" class
Creating a child class with extends
The super keyword
No need to create a parent object in order to create a child object from the classes
A naming convention for private properties
Good intentions but not enforced by the code
Factory Functions
Instantiating a pizza factory object
Factory Functions solve the private properties problem
New additions to JS allow public and private class fields
How much support for public and private class fields?
Taught by
Dave Gray
Related Courses
Introduction à la programmation orientée objet (en Java)École Polytechnique Fédérale de Lausanne via Coursera C++ For C Programmers, Part A
University of California, Santa Cruz via Coursera Introduction to Programming for Musicians and Digital Artists
California Institute of the Arts via Coursera Beginning Game Programming with C#
University of Colorado System via Coursera Paradigms of Computer Programming
Université catholique de Louvain via edX