1. Proper tail call (recursion without using caller scope)
tail call - last instruction should be a fun without using caller scope
close call
tail position
max recursion number ~10,000 in ES5
2. Temporal Temp Zone- trows error
3. google traceur-compiler
https://google.github.io/traceur-compiler/demo/repl.html#
there is cmd tool
4. Rest parameters
fun (a, b, ...rest) {
}
4. Spead operator
5. Distructing object
let {name, age} = obj;
fun({name, age}) {}
5.1 Refutable pattern:
let {name:firstName = 'Unknown', age, ?phone} = user;
let ?{name, age, pone} = user;
#irefutable/refutable - undeclared, undefined
let ?{x:a=1} = undefined
let {?x:a=1} = {}
5.2 Destructing array
in method signature: fun([a, b, ...rest]) {}
var [a, b, ?c] = [1,2];
var ?[a, c] = [];
tail call - last instruction should be a fun without using caller scope
close call
tail position
max recursion number ~10,000 in ES5
2. Temporal Temp Zone- trows error
3. google traceur-compiler
https://google.github.io/traceur-compiler/demo/repl.html#
there is cmd tool
4. Rest parameters
fun (a, b, ...rest) {
}
4. Spead operator
5. Distructing object
let {name, age} = obj;
fun({name, age}) {}
5.1 Refutable pattern:
let {name:firstName = 'Unknown', age, ?phone} = user;
let ?{name, age, pone} = user;
#irefutable/refutable - undeclared, undefined
let ?{x:a=1} = undefined
let {?x:a=1} = {}
5.2 Destructing array
in method signature: fun([a, b, ...rest]) {}
var [a, b, ?c] = [1,2];
var ?[a, c] = [];
6. Arrow functions
No comments:
Post a Comment