console.error(). Some error messages lead to quick fixes, while others send programmers on a wild goose chase.
Apart from logging errors as they happen, we might also want to log situations where something erroneous is about to happen. These are warning messages and they're not used as much as they should be in frontend applications. Warnings are especially useful in diagnosing the more insidious problems with our code, as they leave a trail of clues in the wake of a failure.
The user doesn't ...