Add a variable to a class instance at runtime: Difference between revisions
Content added Content deleted
(added PowerShell) |
m (→{{header|JavaScript}}: add lang tag and blurb) |
||
Line 146: | Line 146: | ||
=={{header|JavaScript}}== |
=={{header|JavaScript}}== |
||
This kind of thing is fundamental to JavaScript, as it's a prototype-based language rather than a class-based one. |
|||
<lang javascript> e = {} // generic object |
|||
e.foo = 1 |
e.foo = 1</lang> |
||
=={{header|Perl}}== |
=={{header|Perl}}== |