Condition on a last iteration of loop in React JSX?

Viewed 2817

I have a list of emails I need to loop through and display in this format.

  renderEmaillist() {
    return this.props.OfficeEmailAddress.map((officeEmail) => {
        return (
          <a key={emailID} href={`mailto:${officeEmail}`}>{officeEmail}{'; '}</a>
          );
    });
}

When its rendered

 email@mail.com; email2@mail.com;

I want to remove the semicolon at the end of the last loop only.

What is the bets way to do this?

1 Answers
Related