When I try to push elements into a javascript array, it doesn't work. This is the simplest sample I can come up with. Why doesn't this work?
<!DOCTYPE html>
<html>
<body>
<script>
var i;
var mycars = new Array();
for(i=1;i<=10;i++){
mycars.push[ i.toString()+"-" ];
}
alert(mycars.join(""));
</script>
</body>
</html>