1、将一个字符串分割成有意义的片段
Intl.Segmenter 对象专门为语言敏感的文本分割而生,它允许你将一个字符串分割成有意义的片段(字、词、句)
const segmenter = new Intl.Segmenter(
'zh', { granularity: 'sentence' }
);
console.log(
Array.from(
segmenter.segment(你好,我是 ConardLi。我来了!你是谁?你在哪?),
s => s.segment
)
);
// ['你好,我是 ConardLi。', '我来了!', '你是谁?', '你在哪?']
2、chrome查看元素上的监听事件
getEventListeners(document.querySelector('.ant-modal-header'))
3、元素移动插件
4、页面录屏、回放
5、移动端新尺寸单位(dvh)
5、BroadcastChannel
BroadcastChannel接口代理了一个命名频道,可以让指定 origin 下的任意 browsing context 来订阅它。它允许同源的不同浏览器窗口,Tab 页,frame 或者 iframe 下的不同文档之间相互通信。