The reason the method takes an array is that it adds the attachments to the provided array. This avoids allocation, which is sometimes important in games (though admittedly this particular method is unlikely to be called very often). Also you can more easily add attachments to an array without needing to copy them from one array to another.
Note you need to pass the slot index, not the name string. The index is on the SlotData, so:
var attachments = [];
this.spine.skeleton.skin.getAttachmentsForSlot(slot.data.index, attachments);
Or if you only have the name string:
var attachments = [];
var slotIndex = this.spine.skeleton.data.findSlot("slot name").index;
this.spine.skeleton.skin.getAttachmentsForSlot(slotIndex, attachments);