Phase2Results.php" ); ?> Subclass Arrays - RuntimeWiki

Subclass Arrays

From RuntimeWiki

Jump to: navigation, search

The ability to actually subclass Array. It still can't be done sanely because the "generics" aren't actually generic. They always return instances of Array and not the subtype. E.g.:

var SubArr = function(){}; 
SubArr.prototype = new Array(); 
var a = new SubArr(); 
alert(a.slice(0).constructor == Array);
Personal tools