let  require = ()=>{throw new Error('函数必须传参')}
  let print  = (num=require())=>{console.log(num)}
  print(2)  // 2  
  print(null) // null
  print() // 报错

 

相关文章:

  • 2022-02-27
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-03-11
  • 2022-12-23
  • 2021-06-30
  • 2021-12-27
猜你喜欢
  • 2021-09-02
  • 2022-12-23
  • 2021-10-06
  • 2022-12-23
  • 2021-12-27
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案