You should add a counter argument to your function definition:
function singleDigit(num, counter = 0) { console.log(`called ${counter} times`) //... return singleDigit(number, counter+1) } singleDigit(39)