I found the below script in the answers to another question. It generates an array of random unique numbers from 0 to 4 and works fine in most browsers, but gives a syntax error in Internet Explorer.
const n1 = myQuestions.length;
const n2 = 5;
let pool = [...Array(n1).keys()];
var result = [];
while (result.length < n2) {
let index = Math.floor(Math.random() * pool.length);
result = result.concat(pool.splice(index, 1));
}
This appears to be the line giving the error:
let pool = [...Array(n1).keys()];
I'm not sure specifically why this line is causing an error but my guess is that some of the script is not supported by IE.
Is there a way I could modify this script or add a polyfill so that it works in IE?