0

I have some code whose structure I cannot change. And functions defined in such a manner.

var Something.someFunc = function(e){
    function funcTwo(){

    }
    ...
    ...
    ...
    ...
}

I need to call funcTwo from outside of this structure. How do I go about doing it ? Someone suggested that i would have to use the".prototype" property but I cannot get this to work.

Anyone have a suitable solution, as i cannot change the structure of the code.

1
  • You cannot without changing the code inside Something.someFunc And what is someFunc? Are you creating objects with new Somthing.someFunc()? Commented Jul 18, 2013 at 10:28

1 Answer 1

3

funcTwo is defined in someFunc scope. There is now way for you to get access to it unless you can somehow modify the code.

Sign up to request clarification or add additional context in comments.

1 Comment

Thats what I had thought initially, but a friend told me i could using the prototype property. Thanks for confirming that this cannot be done.

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.