0

Using .slice inside jsx in create-react-app

I tried to do str.slice(0,5) but it gives me an error "str.slice is not a function". Is there any other way to do this?

6th Jun 2019, 10:16 AM
Shawaine
Shawaine - avatar
2 Respostas
+ 4
Use the substring method for string.
6th Jun 2019, 10:29 AM
Gordon
Gordon - avatar
0
I just needed to str.toString().substr(0,5). Thanks.
6th Jun 2019, 10:55 AM
Shawaine
Shawaine - avatar
Quente hoje
.
1 Votes
What?
0 Votes
HTML
0 Votes
Quiz duel
0 Votes
Web
0 Votes
FRC Coding?
1 Votes
help
0 Votes
AI
2 Votes