+ 23

What is the maximum number of parameters we can pass to the function? And, most importantly, WHY?

function someFunc(first, second,.., last) { // some code } last == ??????

27th Sep 2017, 8:14 PM
\__(° = °)__/
26 Respuestas
+ 13
@Abhijet, you didn't understand a question maybe. "can" - a keyword, mate. but thanks for participation🙋
28th Sep 2017, 1:58 AM
\__(° = °)__/
+ 12
thanks guys, but what about internal? restrictions of memory? watch on MDN about definition of function, please. they say that - 255 parameters...
28th Sep 2017, 9:06 AM
\__(° = °)__/
+ 12
nobody home... I meant slack
2nd Oct 2017, 6:04 AM
\__(° = °)__/
+ 11
Guys, sorry for some miscommunication. I read incorrect translation on MDN about parameters of functions. It depends on engines, varies in different engines
2nd Oct 2017, 7:26 AM
\__(° = °)__/
+ 10
antony - 255, but why? I need internal mechanism of this. 1 byte = 8 bit=2**8=256 (but don't sure exactly) how engine, or interpretator works with it?
27th Sep 2017, 9:50 PM
\__(° = °)__/
+ 6
javascript, guys. I need only this language
28th Sep 2017, 5:48 PM
\__(° = °)__/
+ 6
who can give me accurate and concise answer?
29th Sep 2017, 11:02 AM
\__(° = °)__/
+ 6
@bobbie Are you using an Android device? If so, after you have copied the text, tap the screen where you want the text to go, and hold it down until "Paste" pops up on the screen.
2nd Oct 2017, 6:02 AM
David Fuqua
David Fuqua - avatar
+ 5
addressing? and so a bit depth? 32bit/64bit?
29th Sep 2017, 12:41 AM
Andrew Harchenko (Tomsk)
Andrew Harchenko (Tomsk) - avatar
+ 5
Copied from Shane's post. @4rontender, you should join (and anyone else who is interested). Let's chat I have been finding myself in more and more conversations on SoloLearn, via comments and replies, but it's not really a great platform for conversations. So, I've created a new Slack team called SoloLearn Dev Connection. If you'd like to join the team, simply follow this invitation link and join: (link updated 12/5, current link will never expire) https://join.slack.com/t/sololearndevconnect/shared_invite/enQtMjgxNTU0OTY5MjY0LWExM2Y2MTk5OWVjMWNhOWRmN2RmNWQ5ZGQyNTM0MjFmYjNlYzRhNzJmZDg4Nzg4MDhiY2JiZGFkNmJlZDQ1NzU
2nd Oct 2017, 5:25 AM
David Fuqua
David Fuqua - avatar
+ 4
Let me duckduckgo it for you. ;-) "Although there is nothing specific limiting the theoretical maximum number ofarguments in the spec (as thefortheye's answer points out). There are of course practical limits. These limits are entirely implementation dependent and most likely, will also depend exactly on how you're calling the function." https://stackoverflow.com/questions/22747068/is-there-a-max-number-of-arguments-javascript-functions-can-accept
29th Sep 2017, 12:32 PM
Andrew Harchenko (Tomsk)
Andrew Harchenko (Tomsk) - avatar
+ 3
we can pass any number of parameters to the function. But in real project industry recommendation is to pass maximum 5 parameters. If you need to paas more than 5 you should use array or object.
28th Sep 2017, 1:36 AM
Abhijeet Jha
Abhijeet Jha - avatar
+ 3
There is no any proper documentation to say that why the maximum range of parameters is limited.It depends on memory architecture, but in general scenario you can pass (256 in C++ and 127 in C and 255 in java) number of parameters. But are you see any predefined function which requires more than 5 parameters in any language? No. why? because it's industry standard to declare maximum 5. if we pass more than that it's biggest challenge to programmer to call that function by writing so much code.
28th Sep 2017, 2:08 AM
Abhijeet Jha
Abhijeet Jha - avatar
+ 3
Thank you David I will try that
2nd Oct 2017, 6:03 AM
bobbie
bobbie - avatar
+ 2
Is the answer then as many as memory or regiter space allows and it is just not always best practice or coding? arrrg. Unlimited?
28th Sep 2017, 6:45 PM
Scott T. Hamley
Scott T. Hamley - avatar
+ 1
Hey David how did you copy and paste that? I tried Copy Text where it went I have no clue lol
2nd Oct 2017, 5:56 AM
bobbie
bobbie - avatar
0
about the Why! im blank ×_×
27th Sep 2017, 9:26 PM
Antony O. Onyango
Antony O. Onyango - avatar
0
No help here,I want see this 459 parameter code too. It seems like a good start to a programing horror movie. Say it out loud like a pirate, I've heard tales of a 459 parameter code on the 7 seas arrrrg.
28th Sep 2017, 5:39 PM
Scott T. Hamley
Scott T. Hamley - avatar
0
V8? How many? Why? :-)
2nd Oct 2017, 12:01 PM
Andrew Harchenko (Tomsk)
Andrew Harchenko (Tomsk) - avatar