标签 javascript 下的文章

axios({
  method: 'get',
  url: '/reports/interval-dates',
  responseType: 'arraybuffer',
  data: dates
}).then(function(response) {
  let blob = new Blob([response.data], { type: 'application/pdf' })
  let link = document.createElement('a')
  link.href = window.URL.createObjectURL(blob)
  link.download = 'Report.pdf'
  link.click()
})

闭包的概念:为包含外部变量的函数及外部变量所创建的内存栈叫闭包
闭包的作用:通过函数调用的方式改变一个变量从而防止直接修改变量

Closures are created whenever a variable that is defined outside the
current scope is accessed from within some inner scope.



- 阅读剩余部分 -