Blog Archives

Callbacks ?

Tweet What is Callbacks : You pass a function reference as a parameter to another function so that it can be executed at a later time function f1(a){ } function f2(b){ var a=10; b(a); } f2 (f1); Here i am

Posted in Javascript, Node.Js Tagged with: ,

Constructor Function 2 ?

Tweet How Does That Work? Here’s what happens when a function is called with the “new” keyword :- A call to “new Foo()” creates a new object instance, said to be of type “Foo”.The object instance is assigned a prototype

Posted in Javascript Tagged with:

Constructor Function ?

Tweet A Constructor Function : Consider the following function and call to the function: function Foo(){ this.bar = "baz"; console.log(this); } var f = new Foo(); console.log(f.bar); In this example, the “Foo” function is being used as a constructor function

Posted in Javascript Tagged with:

Strict Mode In A Browser

Tweet Modern browsers have a “strict” mode that you can enable with a very simple command: “use strict”.This is done for backward compatibility reasons with older browsers. When “use strict” is set inside of a function, that function is said

Posted in Javascript, Node.Js Tagged with: ,

Simple Function Invocation ?

Tweet Simple Function Invocation The single most basic way to invoke a function in JavaScript is to supply the () parenthesis to a function that is just floating around, waiting to be called. function doStuff(){ console.log("I'm doing blah blah!"); console.log(this);

Posted in Javascript Tagged with:

this javascript ?

Tweet This is always a very confusing to understand “this”.There are only 5 rules you need to understand, to master the value of “this” in any function and any object in JavaScript. These rules are all based on how you

Posted in Javascript Tagged with:

Alert javascript?

Tweet The alert() method displays an alert box with a specified message and an OK button.An alert box is often used if you want to make sure information comes through to the user.If you are getting bored with the built

Posted in Javascript, Node.Js Tagged with:

Closures?

Tweet Closures can be used to keep private data private from outside code. Found very interesting story to understand closures: There was a princess… function princess() { She lived in a wonderful world full of adventures. She met her Prince

Posted in Javascript Tagged with:

Controller ?

Tweet Controllers are the glue between models and views. Controllers receive events and input from views, process them (perhaps involving models), and update the views accordingly. The controller will add event listeners to views when the page loads, such as

Posted in Javascript Tagged with:

Closures ?

Tweet Closure: A closure is an inner function that has access to the outer (enclosing) function’s variables—scope chain. The closure has three scope chains: it has access to its own scope , it has access to the outer function’s variables,

Posted in Javascript Tagged with: