I am encountering an issue with my code. I intend for it to display:
aaa bbb ccc ddd
However, it currently shows:
Undefined bbb Undefined ddd
Is there a way to ensure that test3 is correctly defined outside of the aaa function?
var test1;
var test2;
var test3 = test1 + ' bbb ' + test2 + ' ddd';
var aaa = function() {
var test1 = "aaa";
var test2 = "ccc";
alert(test3);
}
aaa();