Recursive problem in Kotlin. What does this function return?

On hyperskill I encountered such example, which I dont get.

var counter = 3;f
un main() {
if (counter == 0) return
counter -= 1
main()
print(0)
}

Why is it printing 000? I thought it returns kotlin.Unit when counter = 0.Can somebody explain it to me?Edit: I have additional difficulty. I have two main() functions within my .kt file. Which of them will start first and why?

fun main(args: Int) {
print(args)
}

var counter = 6
fun main() {
if (counter == 0) return
counter -= 1
main(counter)
main()
}

submitted by /u/s168501
[link] [comments]