2

Short question. I have the following situation:

function callbackTest(data, callback) {
     callback.call(data);
}

var map = new Map("Worldmap");
var data = "My data";
callbackTest(data, map.processData);

So, my question is, wheather or not it is possible to access the map object from inside the callbackTest function?

1 Answer 1

2

You can't access map unless you pass it in, or processData has a reference back to map. Basically there's no inherent .parentObject property present when dealing with a generic object here.

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

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.