Skip to content
Advertisement

Send multiple strings as separated values

I want to make multiple emails as strings to be separated values. I’m trying something like this:

JavaScript

What am I doing wrong? How to correctly send them ​​to be separated?

Advertisement

Answer

'info@user-mail.com' && 'info@admin-mail.com' is interpreted as a boolean by javascript. Indeed, a no void string is true, so 'info@user-mail.com' && 'info@admin-mail.com' is true.

To pass multiple strings the optimal data structure is an array, of course you can concat multiple strings into one (1) but it is easier to work with arrays because of the integrated methods builded in javascript.

Knowing that you should do :

JavaScript

(1) or use any other type of data

Advertisement