TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Tips to write better JavaScript

3 pointsby aggarwalachalalmost 13 years ago

1 comment

debaclealmost 13 years ago
&#62; 6 Avoid method calls<p>That's not going to make your JS any clearer.<p>After calling BS on #10 below, I went back and tested this one as well. The explicit call was as fast or faster over three attempts. So not only is this poor advice, it's also wrong.<p>&#62; 10 Cache Globals<p>Tested on jsPerf, the difference was negligible (less than half a percent);