

Quick JavaScript Reference on GitHub - r_z_
https://github.com/rzCodes/rzJSFundamentals

======
Rockslide
It's funny to read something like

    
    
      var isString = typeof string === "string" ? true : false;
    

in a file called "bestPractices.js". I'm totally aware that this example is
about the ternary operator and not about boolean logic, but if you want to
teach best practices, then your examples should be the best practice in every
respect.

Testing a boolean expression and assigning "true" or "false" to a variable
accordingly is one of my personal indicators about the advance of someones
mental programming model ;)

So why not instead:

    
    
      var textColor = hasSpellingMistakes(text) ? "#F00" : "#000"

~~~
magic_beans
How would you re-write: var isString = typeof string === "string" ? true :
false;

??

Just curious, as I can't tell what's wrong here...

~~~
Rockslide
Nothing is technically wrong. But I would write it as

    
    
       var isString = typeof string === "string";

