SUPPORT THE SITE WITH A CLICK

Subscribe Rss:

SUPPORT THE SITE WITH A CLICK

Sunday, November 2, 2014

Javascript : You might also like - I

Javascript hoisting

  1. http://jamesallardice.com/explaining-function-and-variable-hoisting-in-javascript/
  2. http://blog.caplin.com/2012/01/18/javascript-is-hard-part-2-the-hidden-world-of-hoisting/
  3. http://code.tutsplus.com/tutorials/the-essentials-of-writing-high-quality-javascript--net-15145
  4. http://www.adequatelygood.com/JavaScript-Scoping-and-Hoisting.html

What's the difference b/w the two declaration methods below ?

var functionOne = function() {
    /* some code */
}
function functionTwo() {
    /* some code */
}
functionOne is defined in-place(until that line, functionOne is undefined),
whereas functionTwo is hoisted to the top of the scope and is available
as function throughtout the scope. 

Logical Q's

  1. true + true  returns 2
  2. Math.min() < Math.max(); will return false