There is always more work to do.

..and I love it.

Mary Wenzel
2 min readNov 2, 2020

Describe one thing you’re learning in class today.

Today I learned a little about for/in and for/of loops, yes more JavaScript.

A for/in loop — loops through the properties of an object

while

A for/of loop — loops through the values of an iterable object

The main purpose of these is to shrink your code, there’s also while and do/while.

What is "use strict";? What are the advantages and disadvantages to using it?

What this is pretty much telling you is to use the below code strictly and without faults or errors.

Strict mode assists in two or three different ways: It discovers some normal coding bloopers, tossing exemptions. Prevents, or throws away errors, when relatively “unsafe” moves are made. It disables things that are confusing or poorly thought out.

Explain function hoisting in JavaScript.

“Hoisting is a JavaScript technique that moves variables and function declarations to the top of their scope before code execution begins. Within a scope no matter where functions or variables are declared, they’re moved to the top of their scope”

Which is a fancy way of saying variables and functions can be called before being declared in your script, they are automatically brought to the top.

Explain the importance of standards and standards bodies like ECMA.

It’s important to have standards because it makes code usable across more platforms.

If we didn’t have something like ECMA then everyone would be using their own ‘standards’ making it harder to keep up with others. When it’s all put into a body like that it is a lot easier to take up new features and allow your code to be used more widely.

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

The main thing I have been working on while coding is organizing. I try to label my HTML in categories so I can find items better, and if I can find them easier I can work better. I have also learned to name my classes and variables more closely to what they are or what they are doing.

I was getting really confused when just typing in general things like ‘a’ or ‘x’.

Another thing I have taken up is checking for errors and duplicated of unnecessary code.

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

The main reason why global variables are discouraged in javascript is that in javascript all code share a single global namespace. Relying too much on global variables can result in collisions between various scripts on the same page.

--

--