Rest parameters and Arguments | JavaScript

  Рет қаралды 14,628

Telusko

Telusko

Күн бұрын

Пікірлер: 19
@techwithsaket827
@techwithsaket827 Жыл бұрын
First time I am saying thanks to any youtuber. Thanks a lot.
@evanc8057
@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!
@gbbarn
@gbbarn 11 ай бұрын
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
@kshitijnegi8151
@kshitijnegi8151 2 жыл бұрын
Its good to learn JS from Telusko as you get to know how he also compares the syntax with JAVA and other languages.
@ewlgirl
@ewlgirl Жыл бұрын
I have watched many video regarding this ,sir ,you are awesome,i got this concept easily
@-UPH-KRISHNAM
@-UPH-KRISHNAM 3 жыл бұрын
There is variable length arguments in python too sir, we use *args
@MuuoMuumbi
@MuuoMuumbi 4 ай бұрын
Thanks a lot, sir, and I think the other language you are talking about which uses args is Python,(args and kwargs)
@gbbarn
@gbbarn 11 ай бұрын
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.
@Morexod999
@Morexod999 2 жыл бұрын
Very good exlpanation, very clearful
@TinyMaths
@TinyMaths 2 жыл бұрын
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-dev
@rahul-java-dev 3 жыл бұрын
Short and Clear 🙏🙏
@ijajulislam7223
@ijajulislam7223 3 жыл бұрын
Awesome content..keep going sir
@Mokhtarmrt
@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
@mydoglovesyogurt Жыл бұрын
use a variable when you need to storage the result.
@et-mental-7396
@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; }
@gbbarn
@gbbarn 11 ай бұрын
The rule of thumb is that less syntax is almost always better.
@jamilvillones5020
@jamilvillones5020 Жыл бұрын
params in c#
@santhoshkumar-qi9bc
@santhoshkumar-qi9bc 3 жыл бұрын
In JavaScript using 3 dots in clone
@N-fc21
@N-fc21 9 ай бұрын
Thank you sir
#45 What is the Rest Parameter? | JavaScript Full Tutorial
10:08
JavaScript REST PARAMETERS in 8 minutes! 🗄
8:06
Bro Code
Рет қаралды 23 М.
How to Fight a Gross Man 😡
00:19
Alan Chikin Chow
Рет қаралды 16 МЛН
What is Recursion? | JavaScript
7:43
Telusko
Рет қаралды 56 М.
#36 What are Parameters and Arguments? | JavaScript Full Tutorial
16:00
The Arguments Object in Functions - JavaScript Tutorial
4:55
Array Method filter map reduce
9:35
Telusko
Рет қаралды 70 М.
Spread and REST operators in Javascript
14:00
Hitesh Choudhary
Рет қаралды 56 М.
Spread Syntax | ...args | JavaScript
2:49
Telusko
Рет қаралды 14 М.
#19 Objects in JavaScript
10:18
Telusko
Рет қаралды 138 М.
Difference Between Rest & Spread Operator ES6
5:15
Rethinking UI
Рет қаралды 17 М.
Inheritance in JavaScript - Prototypal Inheritance tutorial
20:06
Can Java outperform Python in AI development?
7:06
Telusko
Рет қаралды 36 М.