AspNetCore.Docs/aspnet/web-forms/videos/how-do-i/how-do-i-create-and-use-cla...

1.5 KiB

title author description ms.author manager ms.date ms.topic ms.assetid ms.technology ms.prod msc.legacyurl msc.type
How Do I: Create and Use Classes in JavaScript? | Microsoft Docs rick-anderson In this video Chris Pels shows how to create classes in JavaScript with functionality similar to other programming languages with object oriented capabilitie... aspnetcontent wpickett 01/08/2010 article 348d1bda-69e0-4cb5-a59f-a104133c2f93 dotnet-webforms .net-framework /web-forms/videos/how-do-i/how-do-i-create-and-use-classes-in-javascript video

How Do I: Create and Use Classes in JavaScript?

by Chris Pels

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.

▶ Watch video (18 minutes)