-2

below the codes does not work in IE 11 it throws a syntax error in the console how to fix codes for IE 11?

function range(start, end) {
return Array.from(Array(end - start + 1), (_, i) => i + start); 

}

&

getPageList(totalPages, currentPage, paginationSize).forEach( item => {
$("<li>").addClass("page-item")
         .addClass(item ? "current-page" : "disabled")
         .toggleClass("active", item === currentPage).append(
    $("<a>").addClass("page-link").attr({
        href: "javascript:void(0)"}).text(item || "...")
).insertBefore("#next-pages");

});

Myat Su
  • 27
  • 3
  • 1
    Possible duplicate of ["Arrow function" not working in IE, why?](https://stackoverflow.com/questions/40216015/arrow-function-not-working-in-ie-why) – zero298 Apr 11 '19 at 06:58

1 Answers1

0
function range(start, end) {
    //return Array.from(Array(end - start + 1), (_, i) => i + start); 
    return Array.from(Array(end - start + 1), function(_, i) {return i + start }); 
}

&

getPageList(totalPages, currentPage, paginationSize).forEach(function(item) {
        $("<li>").addClass("page-item")
                 .addClass(item ? "current-page" : "disabled")
                 .toggleClass("active", item === currentPage).append(
            $("<a>").addClass("page-link").attr({
                href: "javascript:void(0)"}).text(item || "...")
        ).insertBefore("#next-pages");
 });
Myat Su
  • 27
  • 3
  • Thanks for posting the solution for this issue. I suggest you to try to mark your own answer as an accepted answer for this question after 48 hrs, when it is available to mark. It can help other community members in future in similar kind of issues. Thanks for your understanding. – Deepak-MSFT Apr 12 '19 at 02:22