Mega Code Archive

 
Categories / JavaScript Tutorial / Number Data Type
 

Reference Types

Reference types are commonly referred to as classes. Objects are created by using the new operator and providing the name of the class to instantiate. For example, the following code creates an instance of the Object class: var o = new Object(); JavaScript requires parentheses to be used only if there are one or more parameters. If there are no parameters, the parentheses can be safely omitted: var o = new Object;