BlogPost_203
1-Describe one thing you're learning in class today.Today in class we went over how to plan what you'll do before starting to code. We created a text file called readme.md into which we typed detailed instructions of what we want the thing we're building to do. This was very helpful and I learned that it is easier to go about programming having a clear plan of what you're doing before writing any code.
2-Difference between:
a) function Person(){} b) var person = Person(), and c) var person = new Person()
a) is declaring a function. b) is assigning a variable to call the Person( ) function. c) is creating an object based on the person function.
3-What's the difference between an "attribute" and a "property"?Attributes are in the HTML itself rather than in the DOM. JS DOM Objects have properties and can be accessed using jQuery's prop method. These properties we set in the HTML but are not in the HTML itself like attributes are.
4-What language constructions do you use for iterating over object properties and array items?for loop, for..in, for each..in, map, reduce etc.
5-What is the event loop?It is a design pattern that waits for and dispatches events or messages in a program. It makes Node capable of handling highly concurrent requests while still running "single-threaded". There is generally a main loop that listens for events, and then triggers a callback function when one of those events is detected.
6-What is the difference between call stack and task queue?So in short, a job queue is a queue of things to do (usually stored persistant) and a call stack is a stack of routines. A call stack is a stack data structure that stores information about the active subroutines of a computer program. This kind of stack is also known as an execution stack, control stack, run-time stack, or machine stack, and is often shortened to just "the stack".A job queue (sometimes batch queue), is a data structure maintained by job scheduler software containing jobs to run.
7-What are the differences between ES6 class and ES5 function constructors?ES6 class basically does the work of defining a new object and appending functions to its prototype. ES5 Function constructors work and look the same but the main difference is observed when the developer uses the Inheritance property.
ES6 can be considered as the syntax base for constructor functions. ES5 can only be executed with the help of a new operator.
ES6 class allows the developers to instantiate objects using the new operator. ES5 function constructors focus on how the objects are instantiated.
ES6 also ensure the developer that this keyword which is basically used inside the class only refers to the object that is being created by the developer. ES5 function constructor focus on implementing the reusable object creation code. Any function can be used as a constructor.

0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home