mirror of https://github.com/svaarala/duktape.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
359 B
16 lines
359 B
12 years ago
|
/*===
|
||
|
JOIN
|
||
|
===*/
|
||
|
|
||
|
/* Array prototype functions are generic and can be used with objects
|
||
|
* other than arrays. Here, for instance, we use Array.prototype.toString()
|
||
|
* on a custom object.
|
||
|
*
|
||
|
* Because the custom object has a 'join' function, it is called.
|
||
|
*/
|
||
|
|
||
|
var obj = { join: function() { return 'JOIN'; } };
|
||
|
|
||
|
print(Array.prototype.toString.apply(obj));
|
||
|
|