Question: $(document).ready(function() { var createClickCounter = function() { var count = 0; var clickCounter = function() { count++; console.log(this.id + + count is +
$(document).ready(function() { var createClickCounter = function() { var count = 0; var clickCounter = function() { count++; console.log(this.id + " + count is " + count); }; return clickCounter; }; $("btnCount").click( createClickCounter() ); }); (Refer to code example 18-1) The count variable of the outer function is a. in private state b. the scope chain c. a property d. in global state
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
