In some js library I found this code snippet:
var start, end, sel, scrollPos, subst;
[start, end, scrollPos, sel] = getSelection();
Imo this is not valid assignment but code seems to be working. Can you 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();
}
...