Skip to content

Instantly share code, notes, and snippets.

const NO_ARG = {}
function f(a=NO_ARG,b=NO_ARG,c=NO_ARG, d=NO_ARG, e=NO_ARG) {
switch(NO_ARG) {
case a:
print("a")
return
case b:
print("b")
return
@tasogare3710
tasogare3710 / Reflect_construct.js
Created May 9, 2017 13:01
ClassDeclarationを使わずにArrayのsubtypeを作る。
function A(...args) {
// 厳密に書くと...
//
// const value = Reflect.construct(Array, args, A)
// if(new.target !== undefined) {
// this = value
// } else {
// return value;
// }
//