请帮忙解释下为什么等于37呢
<html>
<head>
<script language="javascript">
function aaa(form){
var b=0
for (var i=0;i<=form.elements.length;i++){
b+=i;
}
alert(b);
}
</script>
<body>
<form name="form1">
<input type="text" name="g" />
<input type="text" name="f" />
<input type="text" name="e" />
<input type="text" name="d" />
<input type="text" name="c" />
<input type="text" name="b"/>
<input type="text" name="a" />
<input type="button" name="h" onClick="aaa(this.form)">
</form>
</body>
</head>
</html>