String and Array methods

my string
my array
my array
string 2

A copy of the JavaScript functions:

// sample-5-array-string.js
// This sample shows String case and string methods

function display()
  {
  var output1 = document.getElementById("output1");
  var output2 = document.getElementById("output2");
  var output3 = document.getElementById("output3");

  // String object
  my_string_object = new String("H-He-Li-Be-B-C-N-O-F-Ne");
  my_array_object  = new Array();

  my_array_object  = my_string_object.split("-");

  small_array = new Array();

  for (var i = 0; i < my_array_object.length; i++ )
    {
    small_array[i] = document.getElementById( "small" + eval(i) );
    small_array[i].value  = my_array_object[i];
    }

  string2 = new String( my_array_object.join("+") );

  output1.value = my_string_object;
  output2.value = my_array_object;
  output3.value = string2;

  }