M
M
Mariana Marianova2018-08-01 15:30:50
JavaScript
Mariana Marianova, 2018-08-01 15:30:50

Why does ie11 complain about these two features?

$(document).on('mousemove', '.transfusionButton', function (event) {
            const buttonProportions = $(this)[0].getBoundingClientRect();
            const {
                clientX
            } = event;
            const {
                left
            } = buttonProportions;
            const x = clientX - left;
            const {
                width
            } = buttonProportions;

            $html.attr('style', `--transfusionPercent:${x - width / 2}px;`);
        });


function getCellsBy(cellIndex) {
            return $(`[data-cell-index=${cellIndex}]`);
        }


It says "Identifier is expected in this string":
const {
     clientX
} = event;

Answer the question

In order to leave comments, you need to log in

1 answer(s)
0
0xD34F, 2018-08-01
@idmarishik

IE does not support destructuring assignment. Just like template strings.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question