Module 2 Wk1 HW

If the variables aren’t defined in front of the function, the javascript interpreter will not factor it into the function.

2. Why do we write 'use strict' at the top of every JS project?

Strict mode makes several changes to normal JavaScript semantics:

Strict mode eliminates some JavaScript silent errors by changing them to throw errors.

Strict mode fixes mistakes that make it difficult for JavaScript engines to perform optimizations: strict mode code can sometimes be made to run faster than identical code that’s not strict mode.

Strict mode prohibits some syntax likely to be defined in future versions of ECMAScript.

It prevents, or throws errors, when relatively “unsafe” actions are taken (such as gaining access to the global object).

It disables features that are confusing or poorly thought out.

Strict mode makes it easier to write “secure” JavaScript.

3. How and why do we write comments in JS code?

To create a single line comment in JavaScript, you place two slashes “//” in front of the code or text you wish to have the JavaScript interpreter ignore.Multi-line comments start with /* and end with */. Any text between /* and */ will be ignored by JavaScript.

4. Why is JavaScript important for professional web developers?

Despite being an interpreted programming language,JavaScript simplifies development of complex webapplications by allowing developers to simplify the application’s composition. The programmers can useJavaScript libraries to create shadow DOM boundaries.

5. Did you finish your Homework Project? Make sure to bring it into class.