var date=new Date();
with(date)
{
var year=getFullYear();
var month=getMonth()+1;
var day=getDay();
println(year+"-"+month+"-"+day);
}
<script type="text/javascript">
var str=[2,4,2];
for(i in str)
{
println(str[i]);
}
</script>