feat(seed): Added ES6's strict mode to a lesson and made verbiage clearer (#16652)

This commit is contained in:
Jason Kao
2018-02-08 07:46:18 -05:00
committed by mrugesh mohapatra
parent 6337592b99
commit 102a233e69

View File

@ -37,6 +37,8 @@
"<blockquote>let camper = 'James';<br>let camper = 'David'; // throws an error</blockquote>",
"This error can be seen in the console of your browser.",
"So unlike <code>var</code>, when using <code>let</code>, a variable with the same name can only be declared once.",
"Note the <code>\"use strict\"</code>. This enables Strict Mode, which catches common coding mistakes and \"unsafe\" actions. For instance:",
"<blockquote>\"use strict\";<br>x = 3.14; // throws an error because x is not declared</blockquote>",
"<hr>",
"Update the code so it only uses the <code>let</code> keyword.",
"<strong>Note</strong><br>Remember that since <code>let</code> prevents variables from being overridden, you will need to remove one of the declarations entirely."