Functions and Variables in JavaScript

Baylee Stovall
2 min readOct 21, 2020

I realized last post I forgot to talk about how life is going before jumping right into questions so I thought I would talk about some things before we get down to business. This week has been really stressful, I’ve currently been diagnosed with Covid-19 AGAIN (despite not having left my house except for work for the past seven months, but I digress…) and this time I haven’t been as physically ill but I have definitely been suffering form “Corona Brain” this time and I’m not going to lie — it’s been making absorbing this week’s class a little bit harder. But luckily Yousif is an amazing instructor and I’m still absorbing some class content. Enough about me, let’s get into it!

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

Basically we’ve been learning all the ins and outs of functions and variables, and there is A LOT. But this has actually been the part in all of this that has clicked in my brain the quickest and made the most sense without a lot of outside research.

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

The “function Person ( ) { }” is creating a function, the “var person =” is a variable to a function, and the “var person = new Person( )” is setting an object to a variable. They all can work together but independently they are all different things.

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

Properties can be almost anything but an attribute can ONLY ever be string.

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

Functions are usually used to iterate over object properties and array items.

5. What is the event loop?

Event loops executes all operations on a single thread.

6. What is the difference between call stack and task queue?

Call stack keeps track of function calls while task queues process web API callbacks once the call stack is cleared.

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

ES6 has many more shorthand function constructors than ES5 does which allows for quicker, easier, and more condensed coding.

Austin Coding Academy

--

--

Baylee Stovall
0 Followers

Current digital artist, nail technician, and makeup artist getting her foot into the door of web development.