Reputation: 13
How can I make this code shorter, is there any way? I feel there's too much repeating..
var bokstaver1:Array = new Array("a", "b", "c");
var bokstaver2:Array = ["d","e","f"];
var bokstaver:Array = New Array();
bokstaver[0] = "b";
bokstaver[1] = "i";
bokstaver[2] = "l";
bokstaver[3] = "l";
bokstaver[4] = "e";
I'm all new here so if this is not a way to ask a question on here please don't hasten insults.
Upvotes: 1
Views: 59
Reputation: 42166
You can do it in this easy way:
var bokstaver:Array = "bille".split("");
trace(bokstaver); // outputs: b,i,l,l,e
Upvotes: 1