I was included 2 javascript files in my app with script tag.
I was declared same variable in both script.
Now my question is, If I run the app will the variable same for two scripts or different for each script.
script 1(external file included).
var myvariable=10;
function(){
...
}
script 2 (external file)
var myvariable=20;
function(){
...
}
Is both myvariables are same for app?
That depends on the scope.
If both variables are global (ie: window.var) then the last variable will over-write the first variable with the same name.
Look into closures to fix this (should you be using conflicting global variables).
Good Luck !!
TO YOUR UPDATED QUESTION:
myvariable is in global scope, after script 2 executes myvariable will be 20.