Learn JavaScript STRING SLICING in 8 minutes! ✂️

Поделиться
HTML-код
  • Опубликовано: 16 сен 2024
  • // string slicing = creating a substring
    // from a portion of another string
    // string.slice(start, end)
    // ----------- EXAMPLE 1 -----------
    const fullName = "Bro Code";
    let firstName = fullName.slice(0, 3);
    let lastName = fullName.slice(4, 8);
    console.log(firstName);
    console.log(lastName);
    // ----------- EXAMPLE 2 -----------
    const email = "Bro1@gmail.com";
    let username = email.slice(0, email.indexOf("@"));
    let extension = email.slice(email.indexOf("@") + 1);
    console.log(username);
    console.log(extension);

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

  • @BroCodez
    @BroCodez  11 месяцев назад +3

    // string slicing = creating a substring
    // from a portion of another string
    // string.slice(start, end)
    // ------------ EXAMPLE 1 ------------
    const fullName = "Bro Code";
    let firstName = fullName.slice(0, 3);
    let lastName = fullName.slice(4, 8);
    console.log(firstName);
    console.log(lastName);
    // ------------ EXAMPLE 2 ------------
    const email = "Bro1@gmail.com";
    let username = email.slice(0, email.indexOf("@"));
    let extension = email.slice(email.indexOf("@") + 1);
    console.log(username);
    console.log(extension);

  • @ethan.creates
    @ethan.creates 10 месяцев назад +4

    bro code doing gods work

  • @ponrajsapient7063
    @ponrajsapient7063 10 месяцев назад +5

    Hey bro!..Big fan of yours... could you please consider to make a playlist on Android development

  • @mueblenudecarpinteriacancu8616
    @mueblenudecarpinteriacancu8616 3 месяца назад +1

    you rock bro! thanks a bunch finally im understanding .js!

  • @piotrmazgaj
    @piotrmazgaj Месяц назад

    This is my seal. I have watched the entire video, understood it, and I can explain it in my own words, thus I have gained knowledge. This is my seal.

  • @marbles5590
    @marbles5590 10 месяцев назад +1

    waiting for your react.js tutorial ^^ i love your videos

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

    ❤❤Hii❤❤
    spreading knowledge
    .Good work.
    😊ज्ञान बांटने से बढ़ता है😊

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

    I'm learning!!

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

    Pls make a course on entity framework core

  • @FireszCh
    @FireszCh 4 месяца назад

    the thumbnail💀
    H e l l o
    Hell
    O

  • @mubashirameer3629
    @mubashirameer3629 8 месяцев назад

    Bro can you teach some x++ coding?

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

    Do django next

  • @nzqxt
    @nzqxt 10 месяцев назад +1

    can u make a rust course ?
    somebody want it too ?

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

    So apparently my first name is 0,4 middle name is 4,12 and last name is 12,18

  • @IamCaptainDeadpo0l
    @IamCaptainDeadpo0l 4 месяца назад

    REDRUM

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

    Hey bro. i created a website using HTML and CSS but how to share that as a URL. please reply

  • @WilliamEngelke-o6q
    @WilliamEngelke-o6q 3 дня назад

    Anderson Kimberly Miller Gary Moore Cynthia

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

    Do django next

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

    Do django next