Syntax
Arrow Function
const test = () => {
...
}const test = function(){
...
}Rest Param & Spread Syntax (...)
Rest Param
function myFun(a, b, ...manyMoreArgs) {
console.log("a", a)
console.log("b", b)
console.log("manyMoreArgs", manyMoreArgs)
}
myFun("one", "two", "three", "four", "five", "six")
// Console Output:
// a, one
// b, two
// manyMoreArgs, ["three", "four", "five", "six"]Spread Syntax
Destructing
?? vs ||
=== vs ==
Last updated