Use Array.from() in $$

This commit is contained in:
Simon Willison 2021-12-14 17:27:00 -08:00 committed by GitHub
parent 100f70f047
commit 6da364d813
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -3,5 +3,5 @@ function $(sel, el) {
}
function $$(sel, el) {
return (el || document).querySelectorAll(sel);
return Array.from((el || document).querySelectorAll(sel));
}