Corrections to the article "10 JavaScript Hacks Every Web Developer Should Know"
See original GitHub issueseveral corrections to the article at https://www.freecodecamp.org/news/javascript-hacks/
x-post from FCC forum, as per support-reply
1.
math.round(math.random*50)
Uncaught ReferenceError: math is not defined
the keyword is Math
, first letter is upper-cased
and its method is .random()
, with brackets at the end
2.
equating Math.round
to ~~
// instead of
math.round(math.random*50)
// use
~~(math.random*50)
~~
acts the same as Math.floor
, since its “~” twice – bitwise inversion two times, decimal part just falls off, as it can only be apllied to integer numbers, and floats are converted on first inversion
3.
You can also use
filter()
together withBoolean
to return all null or undefined values from your array.
no, its literally the opposite. only truthy elements will be returned.
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
10 JavaScript Hacks Every Web Developer Should Know
1. How to Use Shortcuts for Conditionals. JavaScript allows you to use certain shortcuts to make your code easier on the eyes. ·...
Read more >10 JavaScript hacks that developers should know - Medium
In this article, I will share some JavaScript hacks that can be very useful for you, whether you are starting out as a...
Read more >10 HTML5 Hacks Every Web Developer Should Know - DZone
In this article, we discuss 10 HTML5 every web developer should know in order to optimize basic elements of their pages more effectively....
Read more >10 JavaScript Tricks Front End Developers Should Know in ...
1. ?? · 2. ?. · 3. On-demand loading using dynamic import () (optimizing static import) · 4. Simplifying async functions with top-level...
Read more >Hacks Every Web Developer Should Know in 2022 - YouTube
... know ⚡ Get in touch: https://twitter.com/ZaurbekStark▭▭▭▭▭ RECOMMENDED VIDEOS ▭▭▭▭▭➜ 8 Years of Coding in 10 Minutes: htt...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thank you @dym-sh @RandellDawson @scissorsneedfoodtoo I’ve emailed the author so he can make the remaining corrections 👍
The author made some updates and I worked on some additional formatting and wording issues.
Thanks for reporting this @dym-sh. Please let us know if you notice anything else in this or other articles.