[js] add Array.prototype.slice() support