SOURCE

function get_sum(x){
	var result = 0;
  var i = 0;
  for(i; i<x; i++){
		result = result + i;
  }
  return result;
}

var sum = get_sum(1000);

document.write(sum+"<br>");
console 命令行工具 X clear

                    
>
console