JavaScript Pro Tips – Code This, NOT That




New Series! Code this 💪, not that 💩. Learn how to write solid modern JavaScript and avoid bad code from then olden days. https://angularfirebase.com

– Source https://github.com/codediodeio/code-this-not-that-js

Original source


45 responses to “JavaScript Pro Tips – Code This, NOT That”

  1. First of all nice video. I agree with you in almost all tips and I must recognize I should use deconstruction more often.
    But 99% of the time using break points is the best way to debug. Console log is simply not as good as a break point.

  2. The console.log stuff and template literals were pretty nifty, I'd be surprised to meet a JS dev that doesn't know reduce/map/filter/forEach/reduce etc. though. No mention of generators but that's understandable, haven't see it used much.

  3. I'm not sure if these thing were really to be call or can be categorized as 'bad code', with the new ways of coding its just your adapting to the new changes. Also, I know codes you categorized as 'good code' is much more efficient but its making a lot more difficult to read. Although few tips there I saw and overall a great tip. thanks

  4. This is more of a refresher than a teaching tool. You aren't explaining anything in depth and are going extremely fast. If I was just starting this would be more confusing than helpful and anyone currently working with JS would already know this.

  5. I personally think `console.log` is used way too often. A better debugging solution is to have good sourcemaps and then use your web console where you can actually set breakpoints. That way you don't need to set console.log all the time and accidentally commit that debug stuff as well (I know, using es- or tslint helps with that, but still)

  6. Array methods like reduce, map and filter perform much slower than classic for loops. So keep that in mind when you have to process large arrays. For small arrays it doesn't make much difference and the code is prettier, but a classic for loop can be over 10 times quicker.

Leave a Reply