Arrays and Strings

Austin Skrobarczyk
2 min readSep 2, 2020

--

  1. Describe one thing you’re learning in class today.

We learned about arrays and various methods you can use to express or manipulate the data inside them.

2. What is ‘use strict’; ? What are the advantages and disadvantages to using it?

The purpose of "use strict" is to indicate that the code should be executed in "strict mode".

In normal JavaScript, a developer will not receive any error feedback assigning values to non-writable properties.

In strict mode, any assignment to a non-writable property, a getter-only property, a non-existing property, a non-existing variable, or a non-existing object, will throw an error.

3. Explain function hoisting in JavaScript.

Hoisting is a JavaScript mechanism where variables and function declarations are moved to the top of their scope before code execution.

Inevitably, this means that no matter where functions and variables are declared, they are moved to the top of their scope regardless of whether their scope is global or local.

4. Explain the importance of standards and standards bodies like ECMA.

Web standards can give your Web pages greater visibility in Web searches. The main role of the ECMA is to develop Standards and Technical Reports in the area of information and communication technology.

5. What actions have you personally taken on recent projects to increase the maintainability of your code?

Writing out comments to help explain my purpose and end goals of the code so if I have to re-write it or update things I know what's going on ahead of time.

6. Why is it, in general, a good idea to leave the global scope of a website as-is and never touch it?

The primary reason why global variables are discouraged in javascript is that, in javascript, all code shares a single global namespace, also javascript has implied global variables i.e. variables which are not explicitly declared in local scope are automatically added to the global namespace. Relying too much on global variables can result in collisions between various scripts on the same page.

--

--

No responses yet