1
    window.onload = function(){
        var outerFn = function ( oParam ){

                return oParam;  
        }

        var v = OuterFn( 2 );
        alert('V :'+v);
    }

In this function i always get OuterFn not defined. Whats going wrong ??? Can somebody tell me.

0

2 Answers 2

4

OuterFn and outerFn are different things as JavaScript is case sensitive, try it with a small o. Ie:

window.onload = function(){
    var outerFn = function ( oParam ){

            return oParam;  
    }

    var v = outerFn( 2 );
    alert('V :'+v);
}
Sign up to request clarification or add additional context in comments.

Comments

3

Your function is assigned to outerFn variable, so that's why you should call it:

var v = outerFn(2);

JavaScript is case sensitive.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.