3 ms·
For the pragmatics, a simpler and not so cluttered example of the constructor, illustrating what 'this' does and how you can pass 'this' by argument: functio
by hackermom 15y ago
For the pragmatics, a simpler and not so cluttered example of the constructor, illustrating what 'this' does and how you can pass 'this' by argument:
function value()
{
this.v = 32;
}
function twice( n )
{
n.v += n.v;
}
number = new value();
document.write( number.v + ' ' );
twice( number );
document.write( number.v );