<script type="text/javascript">
var arr = new Array();
function sum(n){
return n*(n+1);
}
sum(arr.length);
</script>