SOURCE

// let x=1;

// function f(y=x){
//   let x=2;
//   console.log(x)
//   console.log(y)
// }

// f()

var x=1;

function foo(x,y=function(){x=2}){
  x=3;
  console.log(x)
  y();
  console.log(x)
}
foo(0)
  console.log(x)
  
  
function sortNumbers(){
  return Array.prototype.slice.call(arguments).sort();
}  
const sortNums=(...numbers)=>numbers.sort()
console.log(sortNums(5,11,7,9))


function insert(value) {
  return {into: function (array) {
    return {after: function (afterValue) {
      array.splice(array.indexOf(afterValue) + 1, 0, value);
      return array;
    }};
  }};
}

insert(2).into([1, 3]).after(1); //[1, 2, 3]


let  insert=(value=)>({into:(array)=>{after:(afterValue)=>{
  array.splice(array.indexOf(afterValue) + 1, 0, value);
  return array;
}}})

let insert = (value) => ({into: (array) => ({after: (afterValue) => {
  array.splice(array.indexOf(afterValue) + 1, 0, value);
  return array;
}})});
console 命令行工具 X clear

                    
>
console