Js得到选中的文字
(function getSelectionText() { if (window.getSelection) { return window.getSelection().toString(); } else if (document.selection && document.selection.createRange) { return document.selection.createRange().text; }return '请选取文字'; })();
快速删除文件夹
rmdir /s/q ‘文件路径’ // eg rmdir /s/q d:\123\abc
Ele合并对象
//ele 合并对象方法 function merge(target) { for (let i = 1, j = arguments.length; i < j; i++) { let source = arguments[i] || {}; for (let prop in source) { if (source.hasOwnProperty(prop)) { let value = source[prop]; if (value !== undefined) { target[prop] = value; } } } } return target; };
//ele 合并对象方法
function merge(target) {
// debugger
for (let i = 1, j = arguments.length; i < j; i++) {
let source = arguments[i] || {};
for (let prop in source) {
if (source.hasOwnProperty(prop)) {
let value = source[prop];
if (value !== undefined) {
target[prop] = value;
}
}
}
}
return target;
};