I have created a "Namespace" of sorts using nested objects in Javascript and am trying to "new' up an instance of a javascript object.
//
// Create the ABC.DTO "namespace"
if (typeof (ABC) == 'undefined') var ABC= { DTO: {} };
//
// Define the ListType object
ABC.DTO.ListType = function (pId, pName) {
var id = pId;
var name = pName;
return {
Id: id,
Name: name
}
};
//
// Create an instance of the "listType" object
var type1 = new ABC.DTO.ListType(1, 'Letter Type'); // THROWS ERROR
The error being thrown is "Object doesn't support this action" ... I have reviewed the following posts and, unless I am missing something I feel like the code is conformign correctly. Am I overlooking something?