Today I marked https://stackoverflow.com/questions/30543171/a-callback-function-doesnt-work-in-an-asynchronous-call as a duplicate of How do I return the response from an asynchronous call? (Actually the OP asked the same question earlier, and I had closed it as duplicate).
As it is clear both the questions are regarding handling the value returned by an asynchronous method call in JavaScript. Now is that enough to mark it as duplicate? Was I right in doing so?
Also even after marking it as duplicate I had tried to offer some help to OP by suggesting some code snippets in JSFiddle.
Now the OP is again asking to reopen the question since their issue is not resolved. How should these sorts of cases be handled?
VK.Api.call
) and returning in the anonymous function passed togetFriends
? You essentially moved the return statement to another place; that won't fix the problem. If you read and took the time to fully understand the canonical your first post was marked as a duplicate of, you wouldn't've had to ask a second question—I assure it.