#37 How to use JS return | JavaScript Full Tutorial

แชร์
ฝัง
  • เผยแพร่เมื่อ 16 ก.ย. 2024

ความคิดเห็น • 43

  • @Boyyyyaan
    @Boyyyyaan หลายเดือนก่อน +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

  • @DevDreamer
    @DevDreamer  2 ปีที่แล้ว +13

    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 ปีที่แล้ว +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?

  • @malakaltrabalsi
    @malakaltrabalsi หลายเดือนก่อน +1

    a very clear explanation, THANKS!!!

  • @eggxecution
    @eggxecution ปีที่แล้ว +5

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

  • @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 👍

  • @felipegud951
    @felipegud951 9 หลายเดือนก่อน +2

    best return explanation ever

  • @Faisqll
    @Faisqll ปีที่แล้ว +1

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

  • @Tomer_33
    @Tomer_33 หลายเดือนก่อน +1

    great video!! you helped me so much❤

  • @susboi1704
    @susboi1704 2 ปีที่แล้ว +2

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

  • @mindblown9365
    @mindblown9365 ปีที่แล้ว +2

    Very excellent explanation.

  • @muhammad_pulok
    @muhammad_pulok 7 หลายเดือนก่อน

    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 👍

  • @erikaz6934
    @erikaz6934 5 หลายเดือนก่อน

    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);

  • @kiranshet9260
    @kiranshet9260 ปีที่แล้ว +1

    tanks bro

  • @Tom-xy9gb
    @Tom-xy9gb ปีที่แล้ว +1

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

    • @DevDreamer
      @DevDreamer  ปีที่แล้ว

      You’re welcome! 🙂👍

  • @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

  • @xitefy
    @xitefy 2 ปีที่แล้ว +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  2 ปีที่แล้ว +2

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

  • @amansoni2992
    @amansoni2992 2 ปีที่แล้ว +1

    👍👍👍👍👍👍👍👍👍

  • @rudythorns8411
    @rudythorns8411 ปีที่แล้ว

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

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

  • @ubaid_beast4520
    @ubaid_beast4520 ปีที่แล้ว

    what theme do u use in vs code

  • @blizzards-yt9847
    @blizzards-yt9847 2 ปีที่แล้ว +1

    Which vs code theme you use please tell

    • @DevDreamer
      @DevDreamer  2 ปีที่แล้ว

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

  • @rolandskreslins
    @rolandskreslins ปีที่แล้ว

    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 8 หลายเดือนก่อน

      ​@@DevDreamer🤣

  • @andre-ur6lf
    @andre-ur6lf 8 หลายเดือนก่อน

    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  8 หลายเดือนก่อน +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 8 หลายเดือนก่อน +1

      @@DevDreamer thank you for the explanation