BlogPost_203

James Messina
2 min readFeb 10, 2021

Austin Coding Academy

  1. Today in class I learned about the keyword ‘this’ and how it refers to one instance of running a class. Furthermore, the value of ‘this’ is determined by how the function is called. When you use .bind() method, it sets the value of a function’s ‘this’ regardless of how it is called. I also learned about classes, constructors, and methods built inside a class.
  2. function Person(){} is creating a function named ‘Person’ that has no input parameters so it can’t take in any arguments. Var person = Person() is creating a variable called person(it can be changed/mutated) and assigning it a call to the Person() function. var person = new Person() is creating a person variable and assigning it to a call on the Person class (instantiating a new person).
  3. Attributes are defined by HTML and modified in CSS. For example, an h1 element (with class or id name ‘myHeader’) can be modified in CSS by doing the following: #myheader{color:red} or .myHeader{color:red}. Properties are defined by the DOM and are variable. Attributes are constant. In essence, attributes refer to the additional info of an object while properties describe the characteristics of an object.
  4. In order to iterate over object properties and items in an array, you have to create for loops. For, forEach, and for..of loops work well with arrays and for..in loops work well with objects. You can also use while statements.
  5. The event loop is a programming construct or design pattern that waits for and dispatches messages or events in a program. The event loop works by making a request to some internal or external “event provider”, then calls the relevant event handler. Event Loop has pretty specific work. It has responsibility to see weather the call-stack is empty and does the task queue contains pending task to process. If the call-stack is empty, it will push the task to the call-stack from the queue and the task gets processed.
  6. A call stack is a data structure that keeps track of function calls in a program. When a function is called for execution, it’s being pushed to the stack. It is popped out of the stack when the execution is completed. A task queue is a JS runtime messaging queue which handles tasks allocated by different Web APIs. This queue is dedicated to handle the Web Apis callbacks. The messages are processed once the call stack is clear.
  7. ES6 classes allows the developers to instantiate objects using the new operator. ES5 function constructors focus on how the objects are instantiated.

--

--