JSON.stringify two objects.

JSON.stringify two objects.

Hi, I have two array objects:

  1. pupil = new Array(5);
  2. for(n=0; n<=5; n++){
  3.       pupil[n] = new Object();
  4.       pupil[n].name = "Pupil "+n;
  5.       pupil[n].age = 20+n;
  6. }
The second object is as follows;

  1. subjects = new Array(3);
  2. for(n=0; n<=2; n++){
  3.       subjects[n] = new Object();
  4.       subjects[n].book = "English";
  5.       subjects[n].isbn = 1230
  6. }
I plan to write this to a file.  I can do this with one object array and it works fine but is it possible to write both with something like this?
  1. details = JSON.stringify(pupil) + JSON.stringify(subjects);
Thanks in advance.