📜  JavaScript 代码示例中的闭包是什么

📅  最后修改于: 2022-03-11 15:02:21.186000             🧑  作者: Mango

代码示例6
var returns_a_func = function () {
  var word = 'I can see inside '     function sentence(){    var word2 = 'I can also see outside. '     console.log(word + 'and ' + word2)   }   return sentence;
}var finalSentence = returns_a_func()finalSentence()