0

The code below works in chrome, however when I run it in IE 11 I get a "SCRIPT1006: Expected ')'" error. Is this possible to accomplish in IE?

Code:

    fileInput.addEventListener('change', async function (evnt) {

        for (var i = 0; i < fileInput.files.length; i++) {
            var fileId = 'file' + fileCount.toString();

            const base64String = await fileToBase64(fileInput.files[i]);

            fileList.push(
                {
                    filename: fileInput.files[i].name,
                    fileSize: fileInput.files[i].size,
                    base64: base64String,
                    tableId: tableId,
                    fileId: fileId,
                    documentType: "null",
                    extension: fileInput.files[i].name.split('.')[1]
                });
            fileCount++;
            addToTable(fileList[fileList.length - 1])
        }
    }, false);
kdubbers
  • 33
  • 1
  • 6

1 Answers1

1

IE does not support async - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function#Browser_compatibility

If you compile with something like babel then it can fake it for you.

Rycochet
  • 2,860
  • 1
  • 22
  • 39