Is it possible to create an array and loop through it in JavaScript like below?
<?php
$options = array(
'color' => array('blue', 'yellow', 'white'),
'size' => array('39', '40', '41'),
);
foreach($options as $option => $values){
echo $option.'<br>';
foreach($values as $value){
echo $value.' ';
}
echo '<br>';
}
?>
I checked the internet but I can not find a good example.
Thanks for helping!