Answers for "RangeError"

0

RangeError

//Occurs when passing an invalid value to a function.

let nums = Array(-1);

/*The constructor function Array(n) creates an empty array of length n. 
It is not possible to create an array with negative length, so the code 
results in RangeError: Invalid array length.*/
Posted by: Guest on June-10-2021

Code answers related to "RangeError"

Code answers related to "Javascript"

Browse Popular Code Answers by Language