Calling Anonymous Function While Declaring It

[Solved] Calling Anonymous Function While Declaring It | Scala - Code Explorer | yomemimo.com
Question : calling anonymous function while declaring it

Answered by : parotay

var step = (function(){ // this code is executed immediately, // the return value is assigned to `step`
})();

Source : https://stackoverflow.com/questions/8583548/calling-a-javascript-anonymous-function-right-when-its-declared-doesnt-work | Last Update : Wed, 12 May 21

Answers related to calling anonymous function while declaring it

Code Explorer Popular Question For Scala