Это видео недоступно.
Сожалеем об этом.
slice vs substring method | String Object In JavaScript
HTML-код
- Опубликовано: 30 июл 2022
- 🎁 Join my channel to get access to perks:
/ @codeexplained
🧡 Hello All JavaScript Lovers Outhere!
Today you're going to learn about the String Object In JavaScript.
This tutorial is a series of videos, in each video we will discuss a method (or more) of the String Object in JavaScript.
In today's video, you're going to learn about two string methods, slice and substring, and know the difference between them.
Both slice and substring extract a section of a string and return it as a new string, without modifying the original string.
Syntax:
slice(indexStart)
slice(indexStart, indexEnd)
substring(indexStart)
substring(indexStart, indexEnd)
indexStart is : The index of the first character to include in the returned substring.
indexEnd is : The index of the first character to exclude from the returned substring.
🌍 Social Media Links.
◾ Facebook : / code.explained.official
◾ Twitter : / code_explained
◾ Instagram : / code.explained.official
◾ GitHub : github.com/Cod...
💲 Suppport the Channel
Paypal : paypal.me/Code...
Buy Me a Coffee: www.buymeacoff...
wow wow wow... it's so easy to understand the way you explain... thank you so much
You are most welcome
Wow!! I'm a visual learner and this really helped me. Thanks for taking the time and effort to make this. Well thought out. If you do something like this again it might help a beginner to understand some use cases. Subscribed!
This is how an explanation should be ❤👍
You explained in the way no one did before u.... thnk u..
😊
Brilliant video. I was reading the differences on w3 Schools and just wasn't getting it. This way of visualising it and pointing out the differences really made it easy to learn. Thank you!
perfect to to the point . nice video
thanks man i was reading mdn docs for this but i got better understanding here.
Best Explanation. Thank you.
best illustration i have ever seen
Crystal clear.
Beautifully explained. Thank you so much.
excellent explanation, thanks brother.
Make whole javascript series
Teaching with animation is really look awesome
Thanks a lot
I'm trying to
All negative numbers in substring() are treated as 0. It is interesting that this makes substring(-8, -4) functionally equivalent to substring(0, 0) in that they both return an empty string. The empty string is everywhere and is a subset of every string!!
For substring(), if start is greater than end, arguments are swapped: (4, 1) = (1, 4).
So, for positive numbers, substring() will work in BOTH directions ( LTR and RTL ).
For both positive and negative numbers, slice() WILL NOT work in direction RTL, even if characters exist in that space, i.e. it returns the empty string.
you are the best😩 i love u
Excellent explanation
excellent explanation
Very well explained!!!!! new sub ^^ I didn't know about that negative line of numbers, do you know how it is called?
best video.
Thank you 🙏🏼
You’re welcome 😊
Very good djobs
Negative index for slice doesn't work that way
❤ It's awesome...
Can you share which application you used for create this animation?.
Super
ty
❤❤
Which software do you use ?
this is not correct information. in slice indexEnd value is not included in the result. please verify the result and update the video accordingly. i request not to provide wrong information. though i like you way of presentation.
You made me watch my own video.
And it's your turn to do so.
Please re-watch the video, cause I don't see where I said that indexEnd is included and not excluded.