Is there a way to initialize empty arrays in Javascript the same empty arrays are intialized in php?
$blah = array("0" => "wew", "1" => "fdafa");
foreach ($blah as $blat => $val) {
$arr[] = $val
$arr[$blah][] = 1;
}
Or just
foreach ($blah as $blat => $val) {
$arr[] = $val
}
No, you have to declare the
varand initialize it to[]before pushing items to it.