$.getJSON('https://api.example.com', function (response) { // Executed later, once api.example.com responds with data. console.log('Second: Just got data!'); }); // Executed immediately, even before the API responds. console.log('First: No data yet!');