前端知识分享

一、判断变量的类型: typeof(data) === "类型"? true : false; 二、2-一、去除字符串空格:  去除全部空格:str = str.replace(/\s*/g,"");  去除两头空格: str = str.replace(/^\s*|\s*$/g,"");  去除左空格:str = str.replace(/^\s*/,"");  去除右空格:str str.re
相关文章
相关标签/搜索