I just want know why
const getElement = (selector, scope = window.document) => scope.querySelector(selector); const getElement = (selector, scope) => (scope || window.document).querySelector(selector);
will catch error querySelector is not a function
when called it in DOMContentLoaded
block. Object window
should already exist.
没有评论:
发表评论