JavaScript TypeError – More arguments needed

This JavaScript exception more arguments needed occurs if there is an error in the way of function is called. If a few arguments are provided then more arguments need to be provided.

Message:

TypeError: argument is not an Object and is not null (Edge)
TypeError: Object.create requires at least 1 argument, but only 0 were passed
TypeError: Object.setPrototypeOf requires at least 2 arguments, but only 0 were passed
TypeError: Object.defineProperties requires at least 1 argument, but only 0 were passed

Error Type:

TypeError

Cause of Error: There is an error with the way the function is called. More arguments might need to be provided.

Example 1: In this example, the Object.create requires at least 1 argument, but nothing is passed, So the error has occurred.



HTML

filter_none

edit
close

play_arrow

link
brightness_4
code

<script>
    // TypeError
    var GFG_Obj = Object.create(); 
</script>

chevron_right


Output(in console):

TypeError: argument is not an Object and is not null

Example 2: In this example, the Object.setPrototypeOf requires at least 2 arguments, but only 1 is passed, So the error has occurred.

HTML

filter_none

edit
close

play_arrow

link
brightness_4
code

<script>
    var GFG_Obj = Object.setPrototypeOf({});
</script>

chevron_right


Output:

TypeError: argument is not an Object and is not null

full-stack-img

My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.


Article Tags :

Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.