ref!: use default parameters to break compatibility with older browsers
This commit is contained in:
parent
be92cb7aa2
commit
8084f8ff30
|
@ -1,7 +1,7 @@
|
|||
function $(sel, el) {
|
||||
return (el || document).querySelector(sel);
|
||||
function $(sel, $parent = document) {
|
||||
return $parent.querySelector(sel);
|
||||
}
|
||||
|
||||
function $$(sel, el) {
|
||||
return Array.from((el || document).querySelectorAll(sel));
|
||||
function $$(sel, $parent = document) {
|
||||
return Array.from($parent.querySelectorAll(sel));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue