Skip to content

Javascript dictionary

  • Container components : how things work (opposite = presentational)
  • Presentational components: how things look. Opposite = container) Presentational vs container components
  • Declarative: what should happen (fe third-party languages, libraries, framework). Opposite = imperative)
  • Function: f(x). Takes direct inputs, does operations on inputs and returns a direct output (no side-effects). All functions are procedures, but not all procedures are functions. A function without a return value is a procedure.
  • Functional programming : use proven patterns, avoid side-effects if possible. Write pure functions and comment side-effects (= code effects outside the scope of a function, fe changing a global variable)
  • Imperative : how to accomplish a task, not interpreting anything (fe assembly language)
  • Presentational components: how things look. (Opposite = container) Presentational vs container components
  • Procedure: collection of operations
  • Pure function: Same input ALWAYS returns same output
  • Unary function: Function with one parameter
  • Binary function: Function with two parameters
  • Isomorphic: a web app that blends a server-rendered web app with a single-page application. On the one hand, we want to take advantage of fast perceived performance and SEO-friendly rendering from the server.
  • Event capturing and Event bubbling: Basically there are two event models in javascript. Event capturing and Event bubbling. In event bubbling, if you click on inside div, the inside div click event fired first and then the outer div click fired. while in event capturing, first the outer div event fired and than the inner div event fired. To stop event propagation, use this code in your click method.
    if (!e) var e = window.event; e.cancelBubble = true; if (e.stopPropagation) e.stopPropagation();
Published inJS

Be First to Comment

Leave a Reply

Your email address will not be published. Required fields are marked *