Это видео недоступно.
Сожалеем об этом.

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

Комментарии • 32

  • @shumonuddin6806
    @shumonuddin6806 2 года назад +6

    wow wow wow... it's so easy to understand the way you explain... thank you so much

  • @NYC_CuriousG
    @NYC_CuriousG Год назад +5

    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!

  • @Surya_Kiran_K
    @Surya_Kiran_K Год назад +3

    This is how an explanation should be ❤👍

  • @shweta8932
    @shweta8932 6 месяцев назад +2

    You explained in the way no one did before u.... thnk u..
    😊

  • @bradderzthebell
    @bradderzthebell 6 месяцев назад

    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!

  • @indranathghosh5327
    @indranathghosh5327 9 месяцев назад +3

    perfect to to the point . nice video

  • @maverickansh
    @maverickansh Год назад +1

    thanks man i was reading mdn docs for this but i got better understanding here.

  • @codexakshay2348
    @codexakshay2348 5 месяцев назад

    Best Explanation. Thank you.

  • @Yan-oe2mw
    @Yan-oe2mw Год назад

    best illustration i have ever seen

  • @cailarchitectatopks
    @cailarchitectatopks 6 месяцев назад

    Crystal clear.

  • @mdhabibullaharafatridoy9288
    @mdhabibullaharafatridoy9288 Год назад +1

    Beautifully explained. Thank you so much.

  • @ibex33
    @ibex33 9 месяцев назад +1

    excellent explanation, thanks brother.

  • @vinaypatil8009
    @vinaypatil8009 2 года назад +3

    Make whole javascript series
    Teaching with animation is really look awesome

  • @stephen1569
    @stephen1569 Год назад +1

    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.

  • @Devanetworks
    @Devanetworks Год назад +1

    you are the best😩 i love u

  • @shakil-the-coding-monster
    @shakil-the-coding-monster Год назад

    Excellent explanation

  • @R41KHD
    @R41KHD 10 месяцев назад

    excellent explanation

  • @juancaca1993
    @juancaca1993 Год назад +1

    Very well explained!!!!! new sub ^^ I didn't know about that negative line of numbers, do you know how it is called?

  • @selvaganeshm1914
    @selvaganeshm1914 10 месяцев назад

    best video.

  • @volodymyrpivtoranis6648
    @volodymyrpivtoranis6648 2 года назад +1

    Thank you 🙏🏼

  • @diatm1506
    @diatm1506 9 месяцев назад

    Very good djobs

  • @ragularvind5906
    @ragularvind5906 Год назад +2

    Negative index for slice doesn't work that way

  • @truthfinder3084
    @truthfinder3084 Год назад +1

    ❤ It's awesome...
    Can you share which application you used for create this animation?.

  • @luckybeast4757
    @luckybeast4757 7 месяцев назад

    Super

  • @Zer0Cr4ckxd
    @Zer0Cr4ckxd 7 месяцев назад

    ty

  • @igu642
    @igu642 11 месяцев назад

    ❤❤

  • @devamrh
    @devamrh 7 месяцев назад

    Which software do you use ?

  • @shikharana1587
    @shikharana1587 7 месяцев назад

    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  7 месяцев назад

      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.