What happens if local functions are declared inside loop
I have a code like below, which declares local functions inside a for-loop.
Are there any problems or differences if they are declared outside the for-loop?
fun main() {
fizzbuzz(1, 10)
}
fun fizzbuzz(start: Int, end: Int): Unit {
for (k in start..end) {
// local functions inside loop?
fun isFizz(): Boolean = k % 3 == 0
fun isBuzz(): Boolean = k % 5 == 0
when {
isFizz() && isBuzz() -> println("Fizz Buzz")
isFizz() -> println("Fizz")...