+ 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 == ??????
26 Answers
+ 13
@Abhijet, you didn't understand a question maybe.
"can" - a keyword, mate.
but thanks for participation🙋
+ 12
thanks guys, but what about internal? restrictions of memory? watch on MDN about definition of function, please. they say that - 255 parameters...
+ 12
nobody home... I meant slack
+ 11
Guys, sorry for some miscommunication. I read incorrect translation on MDN about parameters of functions. It depends on engines, varies in different engines
+ 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?
+ 6
I had come across a legacy code where it was 459 parameters in function call and worked fine.. but i udnt recommend anyone to do something as bad :)
https://www.google.ru/search?newwindow=1&client=ms-android-huawei&ei=8zLNWfqgEMy96ASQx63ADw&q=talk+is+cheap+show+me+the+code&oq=talk+is+cheap+s&gs_l=mobile-gws-serp.1.0.0l5.4497.6447.0.7723.3.3.0.0.0.0.141.274.0j2.2.0.dummy_maps_web_fallback...0...1.1j4.64.mobile-gws-serp..1.2.273...0i67k1.113.tDYaQEl96r4#imgrc=xlOTRh5M556txM:&xxri=0
+ 6
javascript, guys. I need only this language
+ 6
who can give me accurate and concise answer?
+ 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.
+ 5
addressing? and so a bit depth? 32bit/64bit?
+ 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
+ 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
+ 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.
+ 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.
+ 3
Thank you David I will try that
+ 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?
+ 1
Hey David how did you copy and paste that? I tried Copy Text where it went I have no clue lol
0
about the Why! im blank ×_×
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.
0
V8? How many? Why? :-)