What causes an array, in a Squarespace site, initialized as = [] ,to be populated with objects prior to the first reference to it?
问题 I wrote some JavaScript to intercept form data on a submit event, and to build an array of objects from the several <select> fields, processing one field per iteration of a loop that grabs the field value and pushes it into an array. Each iteration should construct and push() one object into the array unitl all form fields have been processed. Instead, on this test page on my website, I get the complete array of all the objects from all the form fields on the first iteration prior to the