How to string concatenation [Solved]

I want to read array and set id to string value.
This is the way I code ,please help me to sort this out

var a;
      this.selectedProductIds.forEach(element => {
          a=+element.id
        });

Hi, you could do something like this

const selectedProductIds = [1, 3, 5, 7];

const a = selectedProductIds.join(’ ');

1 Like

Thank you @ormasoftchile , This is work for me

1 Like