<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
<div>5</div>
<script>
class Arrays{
constructor(){
}
slice(start,end){
// console.log(this);
if(start<0) start=this.length+start;
if(end<0) end=this.length+end;
if(start===undefined) start=0;
if(end===undefined) end=this.length;
var a=[];
for(var i=start;i<end;i++){
a.push(this[i]);
}
return a;
}
}
var divs=document.getElementsByTagName("div");
arr=[].slice.call(divs);
console.log(arr);
</script>