ассоциативный массив





js/script.js
  • var ara = Object();
  • ara['one'] = 1;
  • ara['two'] = 2;
  • ara['three'] = 3;
  • ara['four'] = 4;
  • ara['five'] = 5;
  •  
  • function funMake() {
  •  for(var i in ara) {
  •   document.write(ara[i] + '&nbsp');
  •  }
  • }
var ara = Object();
ara['one'] = 1;
ara['two'] = 2;
ara['three'] = 3;
ara['four'] = 4;
ara['five'] = 5;

function funMake() {
 for(var i in ara) {
  document.write(ara[i] + ' ');
 }
}


index.html
  • <!DOCTYPE html>
  • <html>
  • <head>
  •  <meta charset="utf-8" />
  •  <title>New Page</title>
  •  <script src="js/script.js"></script>
  • </head>
  • <body>
  • <script>
  •  funMake();
  • </script>
  • </body>
  • </html>
  • <!DOCTYPE html>
  • <html>
  • <head>
  •  <meta charset="utf-8" />
  •  <title>New Page</title>
  •  <script src="js/script.js"></script>
  • </head>
  • <body>
  • <script>
  •  funMake();
  • </script>
  • </body>
  • </html>