Function Scoping: Function can be called before it is defined. Look at below example.
Function : By default every function is like default constructor with inbuilt arguments.
We can also put debugger; to put a breakpoint and debug to step-in, step-out, step-over in vs 2010.
In short we can defined function with NO Input Argument but we can pass multiple input parameter values of any type while calling a function.
f2(17, 0.1, "Ninja", [], {});
function f2()
{
//Fn Responsibilty & Operations.
}
Interesting facts: Inside a function we can fetch the inputs values to the function through a array called arguments[].Internally it is stored in arguments[] array placeholder where we can reference and use the input values for the operations.
Output
No comments :
Post a Comment