June 2017
— I'm desperately missing a way for arrow functions to call themselves
So I came up with this:
const selfref = (f, ...args) =>
f.call(this, (...args) =>
selfref(f, ...args), ...args);
selfref((self, a, b, c) => { self(a, b, c); // calls the current // function again});
— Lol
— I just realized private symbol members can just be wrapped in functions
—
var mySym = Symbol();function doThing(sym) { if (sym === mySym) { // Do something }}
— I did know this before but forgot to mention it last night
— Uhh
— Can be a query or command function I guess
— I see, to avoid exposing the object with the symbol as prop?
— Or?
— Right
— Did you look at this?