Casting strings in javaScript is faster than native!?

This isn't MUCH of a surprise however it's worth noting!  Casting a variable to a string vs. "String()" or "myVar.toString()" is DRASTICALLY faster.

PERF TIME!

Enjoy!

To view or add a comment, sign in

More articles by Addam M. Driver

  • Front-End, JavaScript, UI Engineering, NodeJs Hiring Managers & Developers...

    Hiring managers of UI Engineering, Front-End Development, NodeJs, React, Angular, jQuery, etc. let's chat.

    2 Comments
  • Code Challenges...

    Throughout my career I've been asked to do "code challenges" when looking for a job. It's pretty common considering I…

    3 Comments
  • Less code doesn't mean FAST!

    So I was on a project to "flatten JSON objects". I went through some standard way of doing it.

    1 Comment
  • Speed up your javaScript Loops!

    If you declare your vars outside of a loop, it will out perform the standard for loop and the array.foreach().

Explore content categories