#37 How to use JS return | JavaScript Full Tutorial

Поділитися
Вставка
  • Опубліковано 20 гру 2024

КОМЕНТАРІ • 44

  • @DevDreamer
    @DevDreamer  3 роки тому +14

    Hey guys don't forget, give the video a THUMBS UP! 🙂👍

  • @fareenah
    @fareenah 2 роки тому +13

    Love that there is a task included in this video, makes for great practice!

  • @SomeGamerNoob
    @SomeGamerNoob 2 роки тому +7

    Three days into learning JavaScript (after getting to an intermediate-ish level in HTML and CSS), I really couldn't understand the purpose of the 'return' statement in a function. This video finally helped it make sense to me, thanks for the thorough explanation and the tasks helped massively too.

    • @RicardoMores-t5m
      @RicardoMores-t5m Рік тому

      The same.
      Can you explain it to me in simple words?

  • @Boyyyyaan
    @Boyyyyaan 4 місяці тому +1

    I've been trying to understand it for over an hour but all the other videos just weren't clear enough. Thank you for this video. It really helped me wrap my head around what return actually does

  • @eggxecution
    @eggxecution Рік тому +5

    Very clear explanation of return, by far tthe video that I understand the most.

  • @mathstravails
    @mathstravails Рік тому +2

    best return explanation ever

  • @SirenOfCode
    @SirenOfCode Рік тому +4

    Thank you for explaining this in laymen terms, I finally understand how to use return function!

    • @DevDreamer
      @DevDreamer  Рік тому

      Thanks for watching! And for the kind comment, really appreciate it, glad it was helpful 👍

  • @malakaltrabalsi
    @malakaltrabalsi 5 місяців тому +1

    a very clear explanation, THANKS!!!

  • @Faisqll
    @Faisqll Рік тому +1

    i love how you give us a lot of expensive knowledge, im so lucky found this channel❤❤❤

  • @mindblown9365
    @mindblown9365 2 роки тому +2

    Very excellent explanation.

  • @bryallen11
    @bryallen11 23 дні тому

    Perfect!!! I just watched another tutorial and wanted to rip my hair out. You are clear, smooth and beautiful!!!

  • @Tomer_33
    @Tomer_33 4 місяці тому +1

    great video!! you helped me so much❤

  • @susboi1704
    @susboi1704 2 роки тому +2

    Great content! You’re doing a great job. Definitely earned a sub❤️

  • @muhammad_pulok
    @muhammad_pulok 10 місяців тому

    Thanks a lot for your awesome explanation.

  • @MichaelJosephGFX
    @MichaelJosephGFX 2 роки тому +1

    thank you! excellent tutorial.

  • @Tessia-ERALITH73
    @Tessia-ERALITH73 Рік тому +1

    Thank you

  • @chandkhan-cn5jn
    @chandkhan-cn5jn Рік тому

    Awesome 👍

  • @Tom-xy9gb
    @Tom-xy9gb Рік тому +1

    You did not just include tasks too?!?!? THANK YOU!

  • @erikaz6934
    @erikaz6934 8 місяців тому

    For the first practice question, I can get the same output by the below input, could you please advice if that works?
    function favNum(num) {
    return("My fav number is " + num);
    }
    favNum(7);

  • @ubaid_beast4520
    @ubaid_beast4520 Рік тому

    what theme do u use in vs code

  • @kiranshet9260
    @kiranshet9260 2 роки тому +1

    tanks bro

  • @johnnyholiday1150
    @johnnyholiday1150 2 роки тому +1

    Hey man thanks for the clear explanation, by the way any chance to know which theme you are using in VS code (in this video)? :p

    • @NisYT
      @NisYT 2 роки тому

      Hey this theme is Atom One Dark, with some edits to the some of the colours, darker background, brighter greens etc. - Stole his comment he posted it down there.

    • @johnnyholiday1150
      @johnnyholiday1150 2 роки тому

      @@NisYT thanks

  • @blizzards-yt9847
    @blizzards-yt9847 3 роки тому +1

    Which vs code theme you use please tell

    • @DevDreamer
      @DevDreamer  3 роки тому

      Hey this theme is Atom One Dark, with some edits to the some of the colours, darker background, brighter greens etc.

  • @amansoni2992
    @amansoni2992 2 роки тому +1

    👍👍👍👍👍👍👍👍👍

  • @rudythorns8411
    @rudythorns8411 2 роки тому

    i need this so bad i cannot sleep without knowing return statement

  • @xitefy
    @xitefy 3 роки тому +2

    Hey Amit!
    How are you doing!
    It would be great if you upload some videos regarding "Responsive" websites or may be a crash course.
    You've had uploaded Media Queries before but kindly elaborate the Responsiveness a lil more.
    Thanks 💚

    • @DevDreamer
      @DevDreamer  3 роки тому +2

      Hey brother, I've got some plans for something like that very soon 😎

  • @arthabhunter
    @arthabhunter Рік тому

    whats worng here whenever i type any thing inside fun its show undefined why
    let fun = function (pass) {
    if(pass === "test123"){
    return "sucessfull";
    }else {
    return "unsecessfull";
    }
    };
    console.log(fun(t))

    • @TheFausto92
      @TheFausto92 Рік тому

      you have to use the "" sign, when you write the t in the console.log("t") because it's a string.

  • @rolandskreslins
    @rolandskreslins 2 роки тому

    Great video, and the task is a great practise tool a well.
    Still, there is no difference in the result, if we use Return or we do not in the second task. Console logs the same thing. Getting frustrated a bit

  • @arthabhunter
    @arthabhunter Рік тому

    is this enough??

  • @mraloush8959
    @mraloush8959 Рік тому +1

    fix your loud microphone please

    • @DevDreamer
      @DevDreamer  Рік тому

      Hi there, thanks for watching but if you are finding it difficult because of the audio, feel free to go elsewhere 👍 hope you get the help you need

    • @magickomchanell4556
      @magickomchanell4556 11 місяців тому

      ​@@DevDreamer🤣

  • @andre-ur6lf
    @andre-ur6lf 11 місяців тому

    Hi there, i tried this code instead and it also still works:
    const favNum = num => {
    console.log(`My fav number is ${num}`)
    }
    favNum(9)
    so in general , can we say that return is not always required in a function? i still dont get the idea of why we should use return, would be great if there is some enlightment about it. thanks

    • @DevDreamer
      @DevDreamer  11 місяців тому +1

      Hi there, so the reason why the arrow function works, is because it has implicit return, return is built into it.
      We use return to make the function easier to call, so rather than saying console log over and over again outside of the function whenever we want to call it, inside the function we simply specify what we want returned, I.e. console log.

    • @andre-ur6lf
      @andre-ur6lf 11 місяців тому +1

      @@DevDreamer thank you for the explanation