






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!







Explain how "this" works - correct answers ✔✔The "this" keyword acts as a reference to the context object. The value of "this" changes, depending on what context you're executing in. Cases:
toLowerCase() toUpperCase() valueOf() array manipulation - correct answers ✔✔http://overapi.com/javascript/ concat() indexOf() join() lastIndexOf() pop() push() reverse() shift() slice() sort() splice() toString() unshift() valueOf() conversion - correct answers ✔✔String.parseInt() returns int String.toUpperCase() ret string String.toLowerCase() ret string String.split() returns array Big O notation - correct answers ✔✔https://rob-bell.net/2009/06/a-beginners-guide-to-big-o-notation/
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Inheritance_and_the_prototype_chain Event Delegation - correct answers ✔✔Event delegation makes use of two features of JavaScript events: event bubbling and the target element. When an event is triggered on an element, for example a mouse click on a button, the same event is also triggered on all of that element's ancestors. This process is known as event bubbling; the event bubbles up from the originating element to the top of the DOM tree. The target element of any event is the originating element, the button in our example, and is stored in a property of the event object. Using event delegation it's possible to add an event handler to an element, wait for an event to bubble up from a child element and easily determine from which element the event originated. A process of using event propagation to handle events at a higher level in the DOM. Allows us to put a single event listener on the parent element instead multiple on all the children. The parent then simply checks the event target property to get the reference to the actual clicked node. Describe event bubbling and event capture. - correct answers ✔✔Event bubbling and capturing are two methods of event delegation in JavaScript. In bubbling the event is first captured and handled by the innermost child element and then propagated to outer parent elements. In capturing the event is first captured by the outermost parent element and propagated to the innermost child element. What's a hash table? - correct answers ✔✔It's a data structure that can map keys to values. A hash table is made up of two parts: an array (the actual table where the data to be searched is stored) and a mapping function, known as a hash function. The hash function is a mapping from the input space to the integer space that defines the indices of the array. In other words, the hash function provides a way for assigning numbers to the input data such that the data can then be stored at the array index corresponding to the assigned number.
What is a linked list? - correct answers ✔✔a linked list is a data structure consisting of a group of nodes which together represent a sequence. Under the simplest form, each node is composed of data and a reference (in other words, a link) to the next node in the sequence; more complex variants add additional links. what is an array? - correct answers ✔✔Array data structure, an arrangement of items at equally spaced addresses in computer memory. Array data type, used in a programming language to specify a variable that can be indexed. Associative array, an abstract data structure model that generalizes arrays to arbitrary indices individually. Traditionally an array reserves a continuous allocation of memory of predefined length. In JavaScript this is not the case. A JavaScript array is simply a glorified object with a unique constructor and literal syntax and an additional set of properties and methods inherited from Array.prototype. If this means we make a small sacrifice in performance, it is more than compensated for by its ease of use and the power of its utilities. Unlike its counterparts in certain other languages, JavaScript arrays are a joy to use - this is something they definitely got right. What is IIFE? - correct answers ✔✔Immediately-Invoking Function Expression (function(){})(); //executes function immediately Explain why the following doesn't work as an IIFE: function foo(){ }(); - correct answers ✔✔When the parser encounters the 'function' keyword in the global scope or inside a function, it treats it as a function declaration (statement), and not as a function expression, by default. You can fix it by wrapping function in parenthesis so parser knows to parse it as a function expression instead of function declaration. What's the difference between a variable that is: null, undefined or undeclared?
var animal1 = Object.create(Animal); animal1.displayType(); // Output:Invertebrates http://stackoverflow.com/questions/6843951/which-way-is-best-for-creating-an-object-in-javascript-is- var-necessary-befor How do you go about testing your Javascript? - correct answers ✔✔Jasmine? How do you organize your code? - correct answers ✔✔Module pattern: meyer, config, base, layout, theme AMD vs. CommonJS? - correct answers ✔✔What? AMD Asynchronous Module Definition
Document load: executes when complete page is fully loaded, including all frames, objects and images Truthy and Falsy - correct answers ✔✔Falsy values: false 0 (zero) "" (empty string) null undefined NaN (a special Number value meaning Not-a-Number) The falsy values null and undefined are not equivalent to anything except themselves