slice vs substring method | String Object In JavaScript

  Рет қаралды 11,241

Code Explained

Code Explained

Күн бұрын

🎁 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...

Пікірлер: 38
@CodeExplained
@CodeExplained 12 күн бұрын
🚨 Big Announcement! 🚨 Hey everyone! I've made a big decision for this channel-I've turned off ads on all my videos! That's right, you can now enjoy all my content ad-free! This means I'm earning $0 from ad revenue, but I believe this is the right move to make your viewing experience better. If you find my content valuable and want to support my work, there are several ways you can help: Like & Share: Simply liking the video and sharing it with friends helps a lot! Subscribe & Hit the Bell: Stay updated and never miss a new video. KZbin Thanks: Use the "Thanks" button below to send a one-time donation. Join the Channel Community: Get exclusive perks and behind-the-scenes content. Buy Me a Coffee: buymeacoffee.com/CodeExplained PayPal Donation: www.paypal.com/paypalme/CodeExplained Every little bit counts and goes directly to creating more high-quality content for you all. Thank you so much for your continued support! Let’s keep growing and learning together! 🌟
@shumonuddin6806
@shumonuddin6806 2 жыл бұрын
wow wow wow... it's so easy to understand the way you explain... thank you so much
@CodeExplained
@CodeExplained 2 жыл бұрын
You are most welcome
@Surya_Kiran_K
@Surya_Kiran_K Жыл бұрын
This is how an explanation should be ❤👍
@NYC_CuriousG
@NYC_CuriousG Жыл бұрын
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!
@CodeExplained
@CodeExplained 21 күн бұрын
Happy to hear that I helped, thanks and welcome!
@shweta8932
@shweta8932 7 ай бұрын
You explained in the way no one did before u.... thnk u.. 😊
@CodeExplained
@CodeExplained 21 күн бұрын
Happy to hear that, thanks!
@codexakshay2348
@codexakshay2348 6 ай бұрын
Best Explanation. Thank you.
@maverickansh
@maverickansh Жыл бұрын
thanks man i was reading mdn docs for this but i got better understanding here.
@indranathghosh5327
@indranathghosh5327 10 ай бұрын
perfect to to the point . nice video
@CodeExplained
@CodeExplained 21 күн бұрын
Happy to hear that, thanks!
@jell._.y
@jell._.y 21 күн бұрын
thank you!!!! very clear and the graphic is very helpful!!
@CodeExplained
@CodeExplained 21 күн бұрын
Happy to hear that I helped!
@bradderzthebell
@bradderzthebell 7 ай бұрын
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!
@ibex33
@ibex33 10 ай бұрын
excellent explanation, thanks brother.
@mdhabibullaharafatridoy9288
@mdhabibullaharafatridoy9288 Жыл бұрын
Beautifully explained. Thank you so much.
@vinaypatil8009
@vinaypatil8009 2 жыл бұрын
Make whole javascript series Teaching with animation is really look awesome
@CodeExplained
@CodeExplained 2 жыл бұрын
Thanks a lot I'm trying to
@Devanetworks
@Devanetworks Жыл бұрын
you are the best😩 i love u
@cailarchitectatopks
@cailarchitectatopks 7 ай бұрын
Crystal clear.
@stephen1569
@stephen1569 Жыл бұрын
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.
@juancaca1993
@juancaca1993 2 жыл бұрын
Very well explained!!!!! new sub ^^ I didn't know about that negative line of numbers, do you know how it is called?
@Yan-oe2mw
@Yan-oe2mw Жыл бұрын
best illustration i have ever seen
@shakil-the-coding-monster
@shakil-the-coding-monster Жыл бұрын
Excellent explanation
@R41KHD
@R41KHD 11 ай бұрын
excellent explanation
@volodymyrpivtoranis6648
@volodymyrpivtoranis6648 2 жыл бұрын
Thank you 🙏🏼
@CodeExplained
@CodeExplained 2 жыл бұрын
You’re welcome 😊
@truthfinder3084
@truthfinder3084 Жыл бұрын
❤ It's awesome... Can you share which application you used for create this animation?.
@ragularvind5906
@ragularvind5906 Жыл бұрын
Negative index for slice doesn't work that way
@selvaganeshm1914
@selvaganeshm1914 11 ай бұрын
best video.
@diatm1506
@diatm1506 10 ай бұрын
Very good djobs
@Zer0Cr4ckxd
@Zer0Cr4ckxd 8 ай бұрын
ty
@luckybeast4757
@luckybeast4757 8 ай бұрын
Super
@devamrh
@devamrh 8 ай бұрын
Which software do you use ?
@igu642
@igu642 Жыл бұрын
❤❤
@shikharana1587
@shikharana1587 8 ай бұрын
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.
@CodeExplained
@CodeExplained 8 ай бұрын
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.
split Method | String Object In JavaScript
3:30
Code Explained
Рет қаралды 21 М.
STOP Using Classes In JavaScript | Prime Reacts
14:02
ThePrimeTime
Рет қаралды 239 М.
Just Give me my Money!
00:18
GL Show Russian
Рет қаралды 1,2 МЛН
An Unknown Ending💪
00:49
ISSEI / いっせい
Рет қаралды 37 МЛН
indexOf and lastIndexOf methods | String Object In JavaScript
9:00
Code Explained
Рет қаралды 8 М.
JavaScript Pro Tips - Code This, NOT That
12:37
Fireship
Рет қаралды 2,5 МЛН
replace and replaceAll methods | String Object In JavaScript
8:46
Code Explained
Рет қаралды 13 М.
Slice and Splice in Javascript
7:56
Hitesh Choudhary
Рет қаралды 76 М.
Array Slice vs. Splice in JavaScript: A HUGE DIFFERENCE
9:50
The Flaws of Inheritance
10:01
CodeAesthetic
Рет қаралды 940 М.
JavaScript Substring Method in 5 Minutes
7:04
James Q Quick
Рет қаралды 10 М.
Learn JAVASCRIPT in just 5 MINUTES (2020)
5:15
Aaron Jack
Рет қаралды 1,5 МЛН
Just Give me my Money!
00:18
GL Show Russian
Рет қаралды 1,2 МЛН