It depends on what you have inside your first() and second() functions.. if you have some async calls, first() may end after second().
For example
function first(){
console.log("I'm first");
}
function second(){
console.log("I'm second");
}
first();
second();
will print
I'm first
I'm second
Now suppose you have an ajax call in your first() function that takes 10 seconds to end:
function first(){
$.ajax({
//--- blah blah
success: function(){
//--- success runs after 10 seconds
console.log("I'm first");
}
})
}
if you run
first();
second();
you will have printed
I'm second
I'm first
Here you can find another example
It depends on what you have inside your first() and second() functions.. if you have some async calls, first() may end after second().
For example
function first(){
console.log("I'm first");
}
function second(){
console.log("I'm second");
}
first();
second();
will print
I'm first
I'm second
Now suppose you have an ajax call in your first() function that takes 10 seconds to end:
function first(){
$.ajax({
//--- blah blah
success: function(){
//--- success runs after 10 seconds
console.log("I'm first");
}
})
}
if you run
first();
second();
you will have printed
I'm second
I'm first
Here you can find another example
It depends on what you have inside your first() and second() functions.. if you have some async calls, first() may end after second().
For example
function first(){
console.log("I'm first");
}
function second(){
console.log("I'm second");
}
first();
second();
will print
I'm first
I'm second
Now suppose you have an ajax call in your first() function that takes 10 seconds to end:
function first(){
$.ajax({
//--- blah blah
success: function(){
//--- success runs after 10 seconds
console.log("I'm first");
}
})
}
if you run
first();
second();
you will have printed
I'm second
I'm first
Here you can find another example
It depends on what you have inside your first() and second() functions.. if you have some async calls, first() may end after second().
For example
function first(){
console.log("I'm first");
}
function second(){
console.log("I'm second");
}
first();
second();
will print
I'm first
I'm second
Now suppose you have an ajax call in your first() function that takes 10 seconds to end:
function first(){
$.ajax({
//--- blah blah
success: function(){
//--- success runs after 10 seconds
console.log("I'm first");
}
})
}
if you run
first();
second();
you will have printed
I'm second
I'm first
Here you can find another example
It depends on what you have inside your first() and second() functions.. if you have some async calls, first() may end after second().
For example
function first(){
console.log("I'm first");
}
function second(){
console.log("I'm second");
}
first();
second();
will print
I'm first
I'm second
Now suppose you have an ajax call in your first() function that takes 10 seconds to end:
function first(){
$.ajax({
//--- blah blah
success: function(){
//--- success runs after 10 seconds
console.log("I'm first");
}
})
}
if you run
first();
second();
you will have printed
I'm second
I'm first
Here you can another example
It depends on what you have inside your first() and second() functions.. if you have some async calls, first() may end after second().
For example
function first(){
console.log("I'm first");
}
function second(){
console.log("I'm second");
}
first();
second();
will print
I'm first
I'm second
Now suppose you have an ajax call in your first() function that takes 10 seconds to end:
function first(){
$.ajax({
//--- blah blah
success: function(){
//--- success runs after 10 seconds
console.log("I'm first");
}
})
}
if you run
first();
second();
you will have printed
I'm second
I'm first
Here you can find another example
It depends on what you have inside your first() and second() functions.. if you have some async calls, first() may end after second().
For example
function first(){
console.log("I'm first");
}
function second(){
console.log("I'm second");
}
first();
second();
will print
I'm first
I'm second
Now suppose you have an ajax call in your first() function that takes 10 seconds to end:
function first(){
$.ajax({
//--- blah blah
success: function(){
//--- success runs after 10 seconds
console.log("I'm first");
}
})
}
if you run
first();
second();
you will have printed
I'm second
I'm first
Here you can another example
It depends on what you have inside your first() and second() functions.. if you have some async calls, first() may end after second().
For example
function first(){
console.log("I'm first");
}
function second(){
console.log("I'm second");
}
first();
second();
will print
I'm first
I'm second
Now suppose you have an ajax call in your first() function that takes 10 seconds to end:
function first(){
$.ajax({
//--- blah blah
success: function(){
//--- success runs after 10 seconds
console.log("I'm first");
}
})
}
if you run
first();
second();
you will have printed
I'm second
I'm first
It depends on what you have inside your first() and second() functions.. if you have some async calls, first() may end after second().
For example
function first(){
console.log("I'm first");
}
function second(){
console.log("I'm second");
}
first();
second();
will print
I'm first
I'm second
Now suppose you have an ajax call in your first() function that takes 10 seconds to end:
function first(){
$.ajax({
//--- blah blah
success: function(){
//--- success runs after 10 seconds
console.log("I'm first");
}
})
}
if you run
first();
second();
you will have printed
I'm second
I'm first
Here you can another example