Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

197
Views
Send multiple strings as separated values

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

sendInquiry: function () {
                const id = '459875';
                const inquiry = {
                    to: 'info@user-mail.com' && 'info@admin-mail.com',
                    senderEmail: this.form.email,
                    senderName: this.form.name,
                    subject: this.form.subject,
                    pN: this.form.personNum,
                    message: this.form.message
                };
}

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

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

'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 :

sendInquiry: function () {
  const id = '459875';
  const inquiry = {
    to: ['info@user-mail.com', 'info@admin-mail.com'],
    senderEmail: this.form.email,
    senderName: this.form.name,
    subject: this.form.subject,
    pN: this.form.personNum,
    message: this.form.message
  };
}

(1) or use any other type of data

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!