First time I am saying thanks to any youtuber. Thanks a lot.
@evanc8057 Жыл бұрын
I have been coding with JS for 4 years and I had no idea that you could do this. So incredibly useful, thank you!
@gbbarn11 ай бұрын
Lol I've been coding for Js for close to 2 months and run into the necessity or creating functions that accepts an undefined number of parameters, like params in c# to put arguments into an array, but ended up learning rest parameters, I just love how ambiguous ECMAScript is!!! How did you survive 4 years without the use of rest params xD
@kshitijnegi81512 жыл бұрын
Its good to learn JS from Telusko as you get to know how he also compares the syntax with JAVA and other languages.
@ewlgirl Жыл бұрын
I have watched many video regarding this ,sir ,you are awesome,i got this concept easily
@-UPH-KRISHNAM3 жыл бұрын
There is variable length arguments in python too sir, we use *args
@MuuoMuumbi4 ай бұрын
Thanks a lot, sir, and I think the other language you are talking about which uses args is Python,(args and kwargs)
@gbbarn11 ай бұрын
Good video! although you forgot to mention that you could rename your rest parameters, instead of ...args you could define it as ...extraElements, for readability sake, one should always do.
@Morexod9992 жыл бұрын
Very good exlpanation, very clearful
@TinyMaths2 жыл бұрын
Just discovering your channel. Thanks for the clear explanation. I was just covering this on the FreeCodeCamp curriculum. Nice video background by the way.
@rahul-java-dev3 жыл бұрын
Short and Clear 🙏🙏
@ijajulislam72233 жыл бұрын
Awesome content..keep going sir
@Mokhtarmrt Жыл бұрын
What is the difference between these 2 codes as the result is the same: function sum(a,b){ return a+b; } let result sum(4,5); console.log(result); AND function sum(a,b){ return a+b; } console.log(sum(4,5)); When should i declare a variable and when not? because i saw many of your videos and you declare variables everywhere without telling why we need to declare them. When should i use a variable in javascript and when not?
@mydoglovesyogurt Жыл бұрын
use a variable when you need to storage the result.
@et-mental-7396 Жыл бұрын
Don't you think this is more efficient: function sum(...args) { let sum = 0; for(let i = 0; i < arguments.length; i++) sum = sum + arguments[i]; return sum; }
@gbbarn11 ай бұрын
The rule of thumb is that less syntax is almost always better.