I am struggling with the correct syntax for iterating through an array to pass properties (and number of items) to an external JS constructor function.
The syntax for the constructor is:
`swal.withForm({
formFields: [
{ id: 'X', type:'Y', name:'Z', value:''},
{etc...} ]
})`
But let's say that the number of formFields is dynamic, and they are stored in an array. How can I iterate through that inside the constructor function? Or is there a way to "paste" the externally created syntax into the function?
Hope this question makes sense.