Skip to Content
0
Sep 04, 2020 at 10:58 AM

IDM 8 RuntimeException - undefined: undefined is not a function

101 Views

Hi all,

I want to use the following code snippet to generate a tmp random code.

var chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
var len = 20;
var randomCode = Array(len).fill(chars).map(function(x) {
        return x[Math.floor(Math.random() * x.length)];
    }).join('');
return randomCode;

However, IDM does not accapt this.. message is RuntimeException - undefined: undefined is not a function (in line starting with "var randomCode.."). When I try the code in a browser/editor, it's working without problems...

Ideas?

Regards, RP