Polymorphic copy: Difference between revisions

Content added Content deleted
(→‎{{header|TXR}}: New section.)
m (→‎{{header|Wren}}: Changed to Wren S/H)
Line 2,245: Line 2,245:


There is no built in 'copy' method - you need to write your own for any class that needs it.
There is no built in 'copy' method - you need to write your own for any class that needs it.
<syntaxhighlight lang="ecmascript">class Animal {
<syntaxhighlight lang="wren">class Animal {
construct new(name, age) {
construct new(name, age) {
_name = name
_name = name