创建堆栈类
function Stack() {
collection = [];
this.print = function() {
console.log(collection);
};
// Only change code below this line
this.push=function(arr){
collection.push(arr);
};
this.pop=function(){
return collection.pop();
};
this.peek=function(){
return collection[collection.length - 1];
};
this.isEmpty=function(){
return collection.length===0;
};
this.clear=function(){
collection = [];
};
// Only change code above this line
}