Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

arguments.length is wrong if there are argument in the function but no arguments supplied #1321

Open
gfwilliams opened this issue Jan 26, 2018 · 0 comments

Comments

@gfwilliams
Copy link
Member

function abc(p1){
console.log(arguments.length);
}
abc();   

As here: http://forum.espruino.com/conversations/316078

This is due to the way Espruino handles function arguments. We can't just not have an argument because then code inside the function would produce a referenceerror.

I think for now this is something we'll have to live with.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant