Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

298 B
Raw Blame
fun returnCallable(a) {
  return x -> x * a
}

let double := returnCallable(2)
let triple := returnCallable(3)

print(double(2)) // 4
print(triple(2)) // 6

print('----------')

fun outer() {
  let x := 'outside'
  fun inner() {
    print(x)
  }

  return inner
}

let closure := outer()
closure()