Javascript hoisting
- http://jamesallardice.com/explaining-function-and-variable-hoisting-in-javascript/
- http://blog.caplin.com/2012/01/18/javascript-is-hard-part-2-the-hidden-world-of-hoisting/
- http://code.tutsplus.com/tutorials/the-essentials-of-writing-high-quality-javascript--net-15145
- 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
- true + true returns 2
- Math.min() < Math.max(); will return false
No comments :
Post a Comment