• kubica@fedia.io
      link
      fedilink
      arrow-up
      0
      ·
      7 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
        2
        ·
        5 days 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.