用JS判斷數據類型(常見四種)

常用的js判斷數據類型(number、boolean、symbol、string、object、undefined、function)方法有三種: typeof判斷 toString判斷 constructor instanceof typeof判斷 typeof判斷基本類型可以(null除外,null也返回object),但是指引類型均返回object,如圖: toString判斷 toStri
相關文章
相關標籤/搜索