Miscelaneous

Here you will find some things that I’m not sure in what category should be placed, but one thing is sure, this are good tools that should be documented.

typeof

Console.log  multiple variables.

This  keyword

if the “this” keyword is outside of an Executions context:  this == Window Object

javascript essentials – lecture: 28, minute: 19:25

when “this” was invoked from an object: it will became the object from where it was directly invoked from.

when “this” was invoked from an event listener: then “this” will be repopulated with an object that represents the DOM Element that the Event was invoked on.

JavaScrip Comparations:

When comparing values in JavaScrip:

  • true === true  –> true
  • 2 === 2 –> true
  • [3] === [3]  –> false    why?

The 3rd reason is because JavaScript compares Primitives by (Values) and Objects by (Reference), Reference is the GPS cordenates of its location in memory, regardless if is a Identical Object, Identical Copy, or New Instance of that Object, all of them have a different Address in Memory Street.

 

x



Copyright 2017. All rights reserved.

Posted January 29, 2017 by Edmundo in category "JS