<script>
let obj = {};
obj.arr = [];
function sortNum(a,b){
return a-b
}
obj.listen = function(fn){
obj.arr.push(fn)
};
obj.trigger = function(){
for(let i = 0;i<this.arr.length;i++){
obj.arr[i](...arguments)
}
}
obj.listen(function(...arguments){
arguments.sort(sortNum);
console.log(arguments)
})
let arr1 = [34,32,15,3,9,17]
obj.trigger(...arr1)
</script>