• kubica@fedia.io
    link
    fedilink
    arrow-up
    17
    ·
    2 days ago

    This is what peak performance looks like:

    console.log("before dothething");
    let r = dothething();
    console.log("after dothething");
    console.log(r);
    
    • darvit@lemmy.darvit.nl
      link
      fedilink
      arrow-up
      1
      ·
      1 hour ago

      Be careful, the actual logging can happen at a later time, and because the log function may take a reference to the value, if you modify r it may show the modified version of r in the logging instead of the original r.