Javascript global variable vs local variable by visionfortech