0

I want to send a evaluation to a meeting guest at the end of the meeting.

I am trying to extract real participants (ones who answer yes to the invitation) using getGuestStatus()

for (var j=0; j<listeParticipants.length;j++) {
  var assiste = listeParticipants[j].getGuestStatus();
  if ( assiste = "YES"){ 
    mailsParti = mailsParti.concat(listeParticipants[j].getEmail()+";");
  }

I don't understand why "assiste" variable stays with the value "YES" even when getGuestStatus return "NO"

As a result all participants are added to mailsParti string.

Thank you for helping (I really feel I'am missing something simple)

Josh Lee
  • 171,072
  • 38
  • 269
  • 275
  • Welcome to SO. Please visit the [help] to see what and how to ask. HINT: Post effort and enough code for a [mcve] – mplungjan Sep 08 '17 at 13:04
  • [Here's an example of a sendMail script](https://stackoverflow.com/a/46109608/7215091). – Cooper Sep 08 '17 at 21:14

1 Answers1

0

if ( assiste = "YES") = is an assigment. == is a comparison.

Reference link

Community
  • 1
  • 1
Cooper
  • 59,616
  • 6
  • 23
  • 54