In some js library, I found this piece of code:
var start, end, sel, scrollPos, subst;
[start, end, scrollPos, sel] = getSelection();
Imo is an invalid destination, but the code works. You can help?
EDIT:
longer version:
...
var start, end, sel, scrollPos, subst;
if (typeof(document["selection"]) != "undefined") {
sel = document.selection.createRange().text;
} else if (typeof(textarea["setSelectionRange"]) != "undefined") {
[start, end, scrollPos, sel] = getSelection();
}
...
source
share