- 2023-05-19js 手写深比较
functionisObject(obj){returntypeofobj==='object'&&obj!==null}functionisEqual(obj1,obj2){if(!isObject(obj1)||!isObject(obj2)){returnobj1===obj2;}if(obj1===obj2){returntrue;}leto
- 2022-11-02深拷贝
functiondeepClone(obj){functionisObject(o){return(typeofo==='object'||typeofo==='function')&&o!==null}if(!isObject(obj)){
- 2022-08-29js 实现解析和构造Url参数
//解析获取的url中的参数为对象functionparseQueryString(url){if(!url){return{};}constqsArr=decodeURIComponent(url).split("?"