Zesty Interview Question

var count = Count(10); count(); // 10 count(); //11 count() // 12 *implement function

Interview Answer

Anonymous

Oct 5, 2023

function Count(start) { var currentCount = start; return function() { return currentCount++; }; }