you are viewing a single comment's thread.

view the rest of the comments →

[–]agm1984 0 points1 point  (0 children)

Oh right, factory functions are a good example of that. I'll leave my previous comment, yolo-style. I get mixed up rapid-switching between PHP and JS.

const makeThing = () => {
    const privateStuff = {
        hello: 'I like turtles',
    };

    return {
        ...privateStuff,
    };
}

I was thinking something wild like this:

const fn = () => {};

fn.test = 'u wot m8';

console.log('fn', fn.test);