.serialize javascript array question

.serialize javascript array question

I've used the .serialize method before on form objects but how can I serialize a standard javascript array?

  1. // this doesn't work 
  2. var myarray = [1, 2, 3, 4];
  3. myarray.serialize();
  4. //error returns:  Uncaught TypeError: Object 1, 2, 3, 4 has no method 'serialize'