rendered paste body-------------------------------------
functions/scopes:
a = {
...
}
-------------------------------------
lambda-scopes:
{
...
}
-------------------------------------
self/calling scopes:
{
...
}()
(a = {
// a can also be re-used
...
})()
-------------------------------------
recursion with scopes:
a = {
if(true) {
a()
}
}
-------------------------------------
while loops:
(while = {
do = {
...
while()
}
if(condition) {
do()
}
})()
-------------------------------------
do-while loops:
(do = {
...
if(condition) {
do()
}
})()
-------------------------------------
scope with arguments (classic function):
fac = (num){
if(num > 0)
num*fac(num-1)
else
1
}
-------------------------------------
currying:
adder = (a){
(b){
a+b
}
}
add2 = adder(2)
four = add2(2)