Echo JS 0.11.0

<~>
tracker1 1724 days ago. link parent 2 points
Even then... most modern JS is written in modules (cjs or esm)...

    //module singleton...
    let numProcess = 0;

    export default { // or module.exports for cjs
      increment: () => numProcess++,
    };

Can still have the internal numProcess private.

Replies

joncys 1718 days ago. link 1 point
This is a very good addition recognising the implicit module environment we're all most probably working in (leveraging tools like Webpack, etc.), thank you for sharing this!