Array index offset : Array « Dojo toolkit « JavaScript Tutorial





<html>
  <head>
    <link rel="StyleSheet" type="text/css"
      href="js/dojo/dijit/themes/tundra/tundra.css">
    <script type="text/javascript">
      var djConfig = {
        baseScriptUri : "js/dojo/",
        parseOnLoad : true
      };
    </script>
    <script type="text/javascript" src="js/dojo/dojo/dojo.js"></script>
    <script>
      dojo.require("dojo.parser");
      dojo.require("dojo.string");
      dojo.addOnLoad(f);
      
      function f(){
        var foo = [1,2,3];
        var bar = [4,5,6,5,6];
        var baz = [1,2,3];

        alert(dojo.indexOf([foo, bar], baz)); 
        alert(dojo.indexOf(foo, 3)); 
        alert(dojo.indexOf(bar, 6, 2));
        alert(dojo.indexOf(bar, 6, 3));
        alert(dojo.lastIndexOf(bar, 6));

        
      }
    </script>
  </head>
  <body class="tundra">
     

</body>
</html>










29.31.Array
29.31.1.Array filter
29.31.2.Array index of
29.31.3.Array index offset
29.31.4.Get last index of
29.31.5.Is array like
29.31.6.Is object an array
29.31.7.Get element index in an array
29.31.8.Get item index