JS錯誤型別

2021-10-11 01:14:50 字數 363 閱讀 3052

一、syntaxerror (語法錯誤)

這種錯誤是最低階的錯誤但是最常見的錯誤,這是在開發中多個標點少個括號,常見於新手

二、referenceerror (引用錯誤)

呼叫的變數或者方法未被定義便會報此錯誤

三、typeerror (型別錯誤)

資料型別錯誤,最常見的是vue中父傳子時props接收引數時容易報該錯誤,子元素接收的是number型別,父元素傳的確實字串便會報錯

四、rangeerror (範圍越界錯誤)

範圍越界,例:new array(-1)

五、urierror (uri不正確)

六、evalerror(已棄用)

eval() 函式中的錯誤

js 常見錯誤型別

1 syntaxerror syntaxerror是解析 時發生的語法錯誤 變數名錯誤 var1a 缺少括號 console.log hello 2 referenceerror referenceerror是引用乙個不存在的變數時發生的錯誤。unknownvariable referenceerr...

js常見錯誤型別

js 錯誤型別 a uncaught typeerror failed to execute getcomputedstyle on window parameter 1 is not of type element 未捕獲的型別錯誤 不能在 視窗 環境上呼叫執行 getcomputedstyle ...

JS各種錯誤型別

js錯誤型別有以下幾種 參考文章 1.syntaxerror 解析 時發生的語法錯誤 var 1a uncaught syntaxerror unexpected number2.referenceerror 引用了乙個不存在的變數 console.log a uncaught referencee...