Forum

JS - prevent from t...
 
Notifications
Clear all

JS - prevent from trailing comma during string join

1 Posty
1 Users
0 Reactions
314 Widok
0
Topic starter

how to prevent from "comma" separated words during map object?

1 Answer
0
Topic starter

add .join("") to map() method like in this code below

        chatToSolidText() {
            let solidText = "";
            solidText = solidText +
                this.chatEntries.map(
                    entry => "bla bla bla"
                ).join("");
            return solidText;
        }

 

Odpowiedź

Author Name

Author Email

Your question *

 
Preview 0 Revisions Saved
Share: