No, the function you provided returns a new associative array with no type information. The constructor you are using looks something like this:
function fixedCatRecord(name, birthdate, mother) { this.name = name; this.birthdate = birthdate; this.mother = mother; }
So you will have an object that knows it as fixedCatRecord, which means that it has access to all the relevant metadata (for example, knowing what methods you can call it).
Keep in mind that both of them can be used with the “new”, but it will be an object of type Object (which is an associative array by default), and not an object of type catRecord.
for example, if you are using something (like Chrome) where console.log provides type information:
// this is an Object, not what you want! console.log(new catRecord("Fluffy", "12/12/12", "Melody")); // this is a fixedCatRecord, good! console.log(new fixedCatRecord("Fluffy", "12/12/12", "Melody"));
source share