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.
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
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);
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.
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 💚
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))
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
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
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.
Hey guys don't forget, give the video a THUMBS UP! 🙂👍
Love that there is a task included in this video, makes for great practice!
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.
The same.
Can you explain it to me in simple words?
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
Very clear explanation of return, by far tthe video that I understand the most.
Thank you! 😀
best return explanation ever
Thank you for explaining this in laymen terms, I finally understand how to use return function!
Thanks for watching! And for the kind comment, really appreciate it, glad it was helpful 👍
a very clear explanation, THANKS!!!
i love how you give us a lot of expensive knowledge, im so lucky found this channel❤❤❤
Very excellent explanation.
Perfect!!! I just watched another tutorial and wanted to rip my hair out. You are clear, smooth and beautiful!!!
great video!! you helped me so much❤
Great content! You’re doing a great job. Definitely earned a sub❤️
Thanks a lot for your awesome explanation.
thank you! excellent tutorial.
Thank you
Awesome 👍
You did not just include tasks too?!?!? THANK YOU!
You’re welcome! 🙂👍
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);
what theme do u use in vs code
tanks bro
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
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.
@@NisYT thanks
Which vs code theme you use please tell
Hey this theme is Atom One Dark, with some edits to the some of the colours, darker background, brighter greens etc.
👍👍👍👍👍👍👍👍👍
i need this so bad i cannot sleep without knowing return statement
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 💚
Hey brother, I've got some plans for something like that very soon 😎
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))
you have to use the "" sign, when you write the t in the console.log("t") because it's a string.
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
is this enough??
fix your loud microphone please
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
@@DevDreamer🤣
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
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.
@@DevDreamer thank you for the explanation