r/javascript • u/__Disaster497 • Sep 18 '22
New Strings Method in ES6 JavaScript
https://techynidhi.hashnode.dev/new-strings-method-in-es6-javascript8
u/anlumo Sep 18 '22
Well, straight to the point. Maybe explaining what they actually do and showing some examples would be nice, although in this case it's pretty self-explanatory.
1
u/__Disaster497 Sep 22 '22
Thanks for the suggestion, it's my first time so, I just wrote that I would be able to understand π π
8
u/yo-chill Sep 18 '22
Why use
`${name}`.method()Instead of just
name.method()6
u/xroalx Sep 18 '22
Well, using template literal will convert
nameto string if it isn't already, which might be useful in certain cases, but if we know it's a string already there's really no point at all.2
1
8
u/__Disaster497 Sep 18 '22
The first article I have ever written π π. Suggest to me, How I can improve though.
Thank You!!!
2
3
u/BrokenLinc Sep 18 '22
Very clear and to the point, I enjoyed it! Some additional use cases might be good. For example, can you use matching strings longer than one character? Showing how to use βpositionβ with βincludesβ, etc. Nice work!
1
2
2
u/No-One-5919 Sep 18 '22
Would be good if you add some description such as:
string methods are way to manipulate and do certain operations on strings.
0
Sep 18 '22
[deleted]
1
u/__Disaster497 Sep 22 '22
Lol...maybe π Btw, sorry it's my first time so, just I have started, also thanks for the consern π
18
u/PooSham Sep 18 '22
Very straightforward. But those aren't really new anymore, es6 has been out there since 2015.