Javascript is getting tougher…

Taylor Cannetti
2 min readNov 1, 2020

Catching up on all of these and remembering how they can help. Just be going through these questions and defining the things I have learned I am able to solidify this new knowledge a little bit more.

“Describe one thing you’re learning in class today.”

We learned about the bind() method and `this` keyword. Bind is helpful when you need to access properties of one class within another class. When a callback function is passed a method on an object, it loses its this value. Bind can fix that and bind the instance to another function.

“What’s the difference between: function Person(){}, var person = Person(), and var person = new Person()?”

After searching around for why you would capitalize the name of a function I found that the proper naming conventions mention to do that with a component. So `function Person(){}` would mean that Person is a component.

Making `var person = Person()` an object creating on the component ‘Person’.

And `var person = new Person()` is proper naming convention for creating a new object off of the class titled ‘Person’.

What’s the difference between an “attribute” and a “property”?

In HTML tags can have attributes and they can be used to assign to that tag on the document object. Anything can be set to an attribute but it becomes a string. Properties are often strings as well but sometimes they can be boolean. Most often the attribute is what is written on the HTML doc and property on the Doc Object.

What language constructions do you use for iterating over object properties and array items?

Loops, lots of loops.

What is the event loop?

A loop that is only invoked when a certain event is called upon.

What is the difference between call stack and task queue?

Call stack will run functions in an order like a list. When you call them they will create a list and execute in the order they are called from top to bottom, but a task queue lets you run them all at the same time or asynchronously.

What are the differences between ES6 classes and ES5 function constructors?

ES6 introduced classes so it didn’t exist until then. ES5 has to create a function every instance this function intends to run and classes helps to clean up that process. It allows you to define the parameters for a function and call an object on that certain instance.

--

--