Question

What is the ouput of following code snippet?

Source: Advanced R by Hadley Wickham

f <- function(x) {
  f <- function(x) {
    f <- function() {
      x ^ 2
    }
    f() + 1
  }
  f(x) * 2
}
f(10)

Answer

Explaination would be updated soon.