Array to String


/ Published in: JavaScript
Save to your folder(s)



Copy this code and paste it in your HTML
  1. //coded by cobra90nj
  2.  
  3. var str = "";
  4.  
  5. var arrname = new Array(5);
  6. arrname[0] = "Hi, ";
  7. arrname[1] = "this ";
  8. arrname[2] = "is ";
  9. arrname[3] = "an ";
  10. arrname[4] = "example.";
  11.  
  12. function arrtostr(arry)
  13. {
  14. for (var n in arry) {
  15. str += arry[n];
  16. }
  17.  
  18. return str;
  19. }
  20.  
  21. alert(this.arrtostr(arrname));

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.