Assing array value inside function : Array : Language Basics JAVASCRIPT DHTML TUTORIALS


JAVASCRIPT DHTML TUTORIALS » Language Basics » Array »

 

Assing array value inside function



<html>
<head>
<script language="JavaScript">
<!--
  var x = new Array();
  function add(arrayName, value) {
    var nextElement = arrayName.length;
    arrayName[nextElement= value;
  }
  x[0"1";
  x[1"2";
  x[2"3";
  add(x, "new value!");
  alert("The new value is: " + x[3]);
//-->
</script>
</head>
</html>

           
       



-

Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .

Follow Navioo On Twitter

JAVASCRIPT DHTML TUTORIALS

 Navioo Language Basics
» Array