/** * 日志对象 log("213") * @type {any} */const log = console.log.bind()/** * 导入js/css资源 */const importResource = (url) => { let tag; if (url.indexOf("css") >= 0) { tag = document.createElement('link'); tag.setAttribute('rel', 'stylesheet'); tag.href = url; } else { tag = document.createElement('script'); tag.setAttribute('type', 'text/javascript'); tag.src = url; } document.documentElement.appendChild(tag);}/** * 隐藏元素 * @param el 元素列表 */const hideEl = (...el) => [...el].forEach(e => (e.style.display = 'none'));/** * 休眠 * @param d 单位:秒 */const sleep = (d) => { for (let t = Date.now(); Date.now() - t <= d * 1000;) { }}/** * 范围随机数 [min,max] * @param min * @param max * @returns {number} */const randomNumber = (min = 0, max = 1) => Math.floor(Math.random() * (max - min + 1) + min);