Js quiz 1 part 2 que no.4

with (function(x, undefined){}) length;

why does this code give ouput as 2 on the console???

Can you send the whole code? Length of a function is number of parameters in it

there’s nothing more in the que thats the only thing given

Ok then you should read this: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/length
Functions length is it’s arguments

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.