Was reading: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode under the Converting mistakes into errors
, and wanted to make a clear example. So I went over to JSFiddle and attempted to see what the 'use strict';
actually achieves. Here is the code:
(() => {
// Strict mode makes assignments which would otherwise silently fail to throw an exception.
'use strict';
try {
const undefined = 666; // throws a TypeError
} catch(error) {
console.error(error)
}
console.log('Is this read?');
})();
https://jsfiddle.net/cvxau3m7/
I was expecting an error to show up in firebug. I must of misunderstood this somehow?