Quantcast
Channel: Active questions tagged javascript - Stack Overflow
Viewing all articles
Browse latest Browse all 138192

How can I handle an array string through Iteration in Typescript

$
0
0

I am having this array of string:

color = ['red','blue','purple'];

I want to print a message that says:

color in ('red','blue','purple')

If I write this:

color.forEach((c) => {
      console.log(`color in ('${c}')`);
    });

I am getting this message:

color in ('red') color in ('blue') color in ('purple')

How can I get the first message?


Viewing all articles
Browse latest Browse all 138192

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>