I need to add in a For Loop characters to an empty string. I know that you can use the function concat in Javascript to do concats with strings
var first_name = "peter";
var last_name = "jones";
var name=first_name.concat(last_name)
But it doesn't work with my example. Any idea of how to do it in another way?
My code :
var text ="";
for (var member in list) {
text.concat(list[member]);
}
for...inbut a normalforloop. More information here: developer.mozilla.org/en/JavaScript/Reference/Statements/… Btw. if you look closely at both of your examples, you can see the difference (name=first_name.concat(last_name)vstext.concat(list[member])