So i spend whole two days on trying to understand this, and maybe im still missing something. I declare global variable in callback, which is executed after recieving json, so why still my var is undefined?
$.getJSON("http://ipinfo.io", callbackFuncWithData);
function callbackFuncWithData(data)
{
response = data;
}
console.log(response);