JavaScript中的ReferenceError和TypeError两种错误的区别
2016-11-22 16:48
302 查看
作为前端工作人员,在调试JavaScript程序的时候经常遇到两个错误:ReferenceError和TypeError。下面就对我这两种错误说说我的见解
1.首先:字面上的意思分别为引用错误和类型错误;
2.作用域:ReferenceError就是在作用域中找不到、TypeError是在作用域中找到了但是 做了它不可能做的事情。
1.首先:字面上的意思分别为引用错误和类型错误;
2.作用域:ReferenceError就是在作用域中找不到、TypeError是在作用域中找到了但是 做了它不可能做的事情。
相关文章推荐
- C++常见错误之error: 'XXX' does not name a type或undefined reference to `__glutInitWithExit'
- javascript最烦人的错误TypeError: string is not a function
- javascript位置错误导致Uncaught TypeError: Cannot read property 'elements' of null
- 编译错误:error: invalid initialization of non-const reference of type ‘*&’ from a temporary of type
- javascript 错误 "Uncaught TypeError: string is not a function"
- JS中的错误异常 TypeError Reference Error
- JavaScript传参时类型错误Uncaught ReferenceError js传递的参数未定义
- error: undefined reference to 'typeinfo for android::MediaSource' 错误解决
- jsValidtion错误 :javascript validation framework 运行时错误 typeError: undefined 任何运行错误
- JavaScript错误之:Uncaught ReferenceError: $ is not defined
- javascript 错误 "Uncaught TypeError: string is not a function"
- 错误和异常的区别(Error vs Exception)
- ERROR :“dereferencing pointer to incomplete type”是什么错误?
- Android Studio打包错误Error:Error: Expected resource of type id [ResourceType]
- Error:Error: Expected resource of type id [ResourceType]打包apk是提示错误
- 区别script中的type=”text/javascript”和language=”Javascript”
- javascript返回前一页的两种方法的区别与好处
- Android SDK低版本切换高版本错误 Error:The number of method references in a .dex file cannot exceed 64K.
- ARM交叉编译器出现如下错误查找Error: internal_relocation (type: OFFSET_IMM) not fixed up
- 【JavaScript】页面加载 解决Uncaught TypeError: Cannot set property of undefined at