Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How can I display these values with spaces to separate the words?

If I’ll console.log(JSON.stringify(selected["1"]?.others)), this is what it shows:

["Cars","Books","Necklaces"]

However, displaying this in the screen, this will display all of the data, however, there are no spaces between each words. It shows like this

CarsBooksNecklaces

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

the others in selected["1"]?.others is an array.

This is what it looks like in firestore:

enter image description here

>Solution :

Since this is an array of string values you could use join method like this:

selected["1"]?.others.join(' ')
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading