說說那些經典的web前端面試題-JavaScript部分

JavaScript中如何檢測一個變量是一個String類型?請寫出函數實現 typeof(obj) === "string" typeof obj === "string" obj.constructor === String 請用js去除字符串空格? 方法一:使用replace正則匹配的方法 去除所有空格: str = str.replace(/\s*/g,""); 去除兩頭空格: str =
相關文章
相關標籤/搜索