Solve the following summation of series using JavaScript?

1=1
1+2=3
1+2+3=6
1+2+3+4=10
...
1+2+3+4+...+n=n*(n+1)/2
<script>
var n=6;
for(i=1;i<=n;i++){
var total=0;
for(j=1;j<=i;j++){
document.write(j)
if(j<i){
if(i!=1){
document.write("+"...