خرید بک لینک

Vote count: 0

In one of Douglas Crockford speeches, He favours the use of tail recursion over loops. this code was presented,

function repeat(myFunc) {
  if (myFunc !== undefined) {
    retu repeat(myFunc);
  }
}

I thought to define a myFunc but don't know if a static counter can retain its state during function calls or use a global counter. but being new to javascript I wanted to ask first. How can this be used in an example, say to count down from 10 to 0? Thanks.

asked 1 min ago

برچسب: نویسنده: استخدام کار تاريخ: دوشنبه 23 فروردين 1395 ساعت: 3:26

صفحه بندی