mirror of
https://github.com/PostHog/posthog.git
synced 2024-11-25 02:49:32 +01:00
31 lines
357 B
Plaintext
31 lines
357 B
Plaintext
|
let b := x -> x * 2
|
||
|
print(b)
|
||
|
print(b(2))
|
||
|
print(b(8))
|
||
|
|
||
|
print('--------')
|
||
|
|
||
|
let func := x -> x * 2
|
||
|
let arr := [func]
|
||
|
|
||
|
print(func(2))
|
||
|
print(arr[1](2))
|
||
|
print((x -> x * 2)(2))
|
||
|
|
||
|
print('--------')
|
||
|
|
||
|
let withArg := x -> {
|
||
|
print(x)
|
||
|
print('moo')
|
||
|
print('cow')
|
||
|
}
|
||
|
withArg(2)
|
||
|
|
||
|
print('--------')
|
||
|
|
||
|
let noArg := () -> {
|
||
|
print('moo')
|
||
|
print('cow')
|
||
|
}
|
||
|
noArg()
|