Reputation: 8759
I know that in JavaScript you can add new properties to an instance of an existing type (like Date), but is it possible to add new properties to an instance of an anonymous type after it's been defined?
For example, say I have the following script:
var employee = {
'Name': 'Scott',
'Age': 32,
'JavaScriptNewbie': true
};
Later on in my script I want to add a new property to this employee object (say, Salary
). Is that possible?
Upvotes: 11
Views: 3077