A
A
Alexandra2020-05-22 01:38:56
JavaScript
Alexandra, 2020-05-22 01:38:56

Why does IE fail to destructure?

I have a simple code, in all browsers of norms, in ie it writes - "It is assumed that there is an identifier" on the line where the function is declared. I understand it's a support issue, but how do I fix it?

pagenavjs({
    pageContainer: '#content',
    navContainer: '#pagination'
});

function pagenavjs({
    pageContainer,
    navContainer
}) {
// Что то там ...
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Y
Yaroslav Ivanov, 2020-05-22
@AlexaShemetova

https://caniuse.com/#search=Shorthand
Don't use shorthand syntax
{ pageContainer: pageContainer , navContainer: navContainer }

pagenavjs({
    pageContainer: '#content',
    navContainer: '#pagination'
});

function pagenavjs(params) {
    // Что то там ...
    params.pageContainer
    params.navContainer
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question