javascript cant access variable inside function code example
Example 1: javascript function call with variable
function abc() {
alert('test');
}
var funcName = 'abc';
window[funcName]();
Example 2: variable used in a function can be used in another function js
function medium(){
var user1=new collector(one,two);
var user2=new collector(one,two);
login(user1,user2);
}
function login(user1,user2){
var u1=user1.username;
var u12=user1.password;
var u2=user2.username;
var u22=user2.password;
}