1 Reply Latest reply on Apr 29, 2006 11:31 AM by Marghoob Suleman

    Clearing an array without deleting it

    DuhChamp Level 1
      What would be the fastest way of clearing an array without deleting it? Could you set all values to null or undefined and it would work? For example, say I have an array of 4 numbers: 3, 4, 5, 6. Now, for some reason I want to clear all the values and set only one value, so now I have an array of 1 number with a length of only 1: 7. How can I do this without deleting the array? Remeber, I only want this array to have a length of one, not 4.