How To Avoid Javascript Bugs

Mainasara πŸ‡³πŸ‡¬ on April 04, 2019

Being a javascript programmer is great but we can never avoid the dreaded stack trace! 😑, most of these bugs are just one Google search away from... [Read Full]
markdown guide

Correct usage.

let laterUsed;

    useVariable(laterUsed || externalAlternativeValue); 
    // βœ… Another value is used when the original value is undefined

hmmm ...

Even More Correct Usage

  .then(result => {
  .catch(e => {
    // handle whatever happens when doAsyncTask() goes wrong

If you're trying to avoid bugs in JavaScript, I'd really recommend

  • not communicating between asynchronous processes using global variables.
  • not using undefined to indicate an error state. Or an absence of value.


code of conduct - report abuse