[js] corrected the way to count items in  FormCollection.addItem