<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Document</title> <script src="http://code.jquery.com/jquery-1.8.0.min.js"></script> </head> <body> <script type="text/javascript"> var arr = [1,2,3,4,5]; console.log(eval(arr.join("+"))); var str=''; for (i in arr){ str+=arr[i]; str+='+'; } str=str.substring(0, str.length - 1); console.log(str); </script> </body> </html>