Zesty interview question

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

Interview Answer

Anonymous

5 Oct 2023

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