How Do I: Create and Use Classes in JavaScript?

Posted in Frameworks, Companies, Development on November 26, 2011


Get Microsoft Silverlight

In this video Chris Pels shows how to create classes in JavaScript with functionality similar to other programming languages with object oriented capabilities. First a sample web site project is created with an external JavaScript file. A function() is created and the difference between using the function as a "function" and as a class constructor with the "new" keyword is discussed. Then public properties are added to the class constructor as well as private variables. Next a separate function is created and assigned as a method to the class. Alternatively, the same method is shown as a function defined in the class constructor. Finally, a private class method is created and used within the class constructor.

Presented by Chris Pels

Date: 08 January 2010

Watch Video Watch Video Watch Video on External Site

Tags: Frameworks, Microsoft, ASP.NET, .NET Framework, Broadcasting, Screencasts, Development, Companies