Skip to content
Related Articles

Related Articles

Improve Article
JavaScript TypeError – More arguments needed
  • Last Updated : 29 Jul, 2020

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




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

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




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

Output:

TypeError: argument is not an Object and is not null
My Personal Notes arrow_drop_up
Recommended Articles
Page :