Answers for "what is a “closure” in javascript? provide an example."

0

A closure Function

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()
Posted by: Guest on June-22-2021
0

closure in javascript

A closure is a function bundeled together with its lexical scope
Posted by: Guest on December-14-2020

Code answers related to "what is a “closure” in javascript? provide an example."

Code answers related to "Javascript"

Browse Popular Code Answers by Language