Yes, you are correct. In my case, all I needed was a way to get number of parameters a function is accepting to solve a specific LeetCode problem. But yes, one should be careful while using length property on functions due to the reasons you've explained with examples.
Thanks!
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Yes, you are correct. In my case, all I needed was a way to get number of parameters a function is accepting to solve a specific LeetCode problem. But yes, one should be careful while using
lengthproperty onfunctionsdue to the reasons you've explained with examples.Thanks!