## 前言
通过本文你将了解js中常见的错误类型,并且希望你能熟悉了解他们。
## 常见格式错误枚举
“Missing semicolon.” : “缺少分号.”,
“Use the function form of \”use strict\”.” : “使用标准化定义function.”,
“Unexpected space after ‘-’.” : “在’-'后面不应出现空格.”,
“Expected a JSON value.” : “请传入一个json的值.”,
“Mixed spaces and tabs.”: “空格和TAB重复.”,
“Unsafe character.” : “不安全的字符.”,
“Line too long.”: “本行中的字符超过设定的最大长度.”,
“Trailing whitespace.”: “本行末尾有过多无用空格.”,
“Script URL.” : “脚本URL.”,
“Unexpected {a} in ‘{b}’.” : “在 ‘{b}’ 中不该出现 {a}.”,
“Unexpected ‘{a}’.” : “不该在此出现’{a}’.”,
“Strings must use doublequote.” : “字符串需要用双引号”,
“Unnecessary escapement.” : “不需要转义”,
“Control character in string: {a}.” : “在字符串中出现了Control的字符”,
“Avoid \\’.” : “避免 \\”,
“Avoid \\v.” : “避免 \\v”,
“Avoid \\x-.” : “避免 \\x-”,
“Bad escapement.” : “错误的转义字符”,
“Bad number ‘{a}’.” : “错误的数字 ‘{a}’”,
“Missing space after ‘{a}’.” : “在’{a}’之后缺少空格”,
“Don’t use extra leading zeros ‘{a}’.” : “不要再’{a}’的前面用多余的0″,
“Avoid 0x-. ‘{a}’.” : “避免使用 0x-. ‘{a}’.”,
“A trailing decimal point can be confused with a dot ‘{a}’.” : “在’{a}’中使用点尾随小数点”,
“Unexpected comment.” : “不该在此处出现注释”,
“Unescaped ‘{a}’.” : “没有转义 ‘{a}’”,
“Unexpected control character in regular expression.” : “在正则表达式中出现了control字符”,
“Unexpected escaped character ‘{a}’ in regular expression.” : “在正则表达式中出现了没有转义的字符 ‘{a}’”,
“Expected ‘{a}’ and instead saw ‘{b}’.” : “应该用 ‘{a}’代替’{b}’”,
“Spaces are hard to count. Use {{a}}.” : “空格难以统计,请使用 {{a}}”,
“Insecure ‘{a}’.” : “不安全的 ‘{a}’”,
“Empty class.” : “空的class”,
“Expected a number and instead saw ‘{a}’.”:“应该用数字代替’{a}’”,
“‘{a}’ should not be greater than ‘{b}’.”:“‘{a}’不应该比’{b}’大”,
“‘hasOwnProperty’ is a really bad name.”: “‘hasOwnProperty’是关键字”,
“‘{a}’ was used before it was defined.”:“‘{a}’未定义就已经使用了.”,
“‘{a}’ is already defined.”:“‘{a}’被重复定义”,
“A dot following a number can be confused with a decimal point.”:“数字后面的一个点会被误认为是十进制的小数点”,
“Confusing minusses” : “容易混淆的负数表达-”,
“Confusing plusses.” : “容易混淆的正数表达+”,
“Unmatched ‘{a}’.” : “无法匹配的’{a}’”,
“Expected ‘{a}’ to match ‘{b}’ from line {c} and instead saw ‘{d}’.”:“在行{c}中需要用’{a}’和’{b}’匹配,用来代替’{d}’”,
“Unexpected early end of program.”:“程序不可预期的提前终止”,
“A leading decimal point can be confused with a dot: ‘.{a}’.”:“‘{a}’前的点容易混淆成小数点”,
“Use the array literal notation [].”:“使用数组的符号 []“,
“Expected an operator and instead saw ‘{a}’.”:“需要用一个符号来代替’{a}’”,
“Unexpected space after ‘{a}’.”:“在’{a}’之后不能出现空格”,
“Unexpected space before ‘{a}’.”:“在’{a}’之前不能出现空格”,
“Bad line breaking before ‘{a}’.”:“在’{a}’之前错误的换行”,
“Expected ‘{a}’ to have an indentation at {b} instead at {c}.”:“‘{a}’需要在{c}而不是{b}处缩进”,
“Line breaking error ‘{a}’.”:“换行错误 ‘{a}’”,
“Unexpected use of ‘{a}’.”:“此处不能用’{a}’”,
“Bad operand.”:“错误的操作数”,
“Use the isNaN function to compare with NaN.”:“使用isNaN来与NaN比较”,
“Confusing use of ‘{a}’.”:“容易混淆的’{a}’的使用”,
“Read only.”:“只读的属性”,
“‘{a}’ is a function.”:“‘{a}’是一个函数”,
‘Bad assignment.’:“错误的赋值”,
“Do not assign to the exception parameter.”:“不要给额外的参数赋值”,
“Expected an identifier in an assignment and instead saw a function invocation.”:“在赋值的语句中需要有一个标识符,而不是一个方法的调用”,
“Expected an identifier and instead saw ‘{a}’ (a reserved word).”:“需要有一个标识符,而不是’{a}’(保留字符)”,
“Missing name in function declaration.”:“在方法声明中缺少名称”,
“Expected an identifier and instead saw ‘{a}’.”:“需要有一个标识符,而不是’{a}’”,
“Inner functions should be listed at the top of the outer function.”:“内部函数的声明应该放在此函数的顶部。”,
“Unreachable ‘{a}’ after ‘{b}’.”:“在’{b}’之后无法获取’{a}’”,
“Unnecessary semicolon.”:“不必要的分号”,
“Label ‘{a}’ on {b} statement.”:“将’{a}’放在{b}的声明中”,
“Label ‘{a}’ looks like a javascript url.”:“‘{a}’看上去像一个js的链接”,
“Expected an assignment or function call and instead saw an expression”:“需要一个赋值或者一个函数调用,而不是一个表达式.”,
“Do not use ‘new’ for side effects.”:“不要用’new’语句.”,
“Unnecessary \”use strict\”.”:“不必要的\”use strict\”.”,
“Missing \”use strict\” statement.”:“缺少\”use strict\”的声明”,
“Empty block.”:“空的模块”,
“Unexpected /*member ‘{a}’.”:“不应出现 /*元素 ‘{a}’.”,
“‘{a}’ is a statement label.”:“‘{a}’是一个声明”,
“‘{a}’ used out of scope.”:“‘{a}’使用超出范围”,
“‘{a}’ is not allowed.”:“不允许使用’{a}’”,
“‘{a}’ is not defined.”:“‘{a}’没有被定义”,
“Use ‘{a}’ to compare with ‘{b}’.”:“使用’{a}’与’{b}’相比”,
“Variables should not be deleted.”:“变量需要被删除”,
“Use the object literal notation {}.”:“使用对象的文字符号 {}”,
“Do not use {a} as a constructor.”:“不要使用{a}作为一个构造对象”,
“The Function constructor is eval.”:“The Function constructor is eval.”,
“A constructor name should start with an uppercase letter.”:“一个构造对象的名称必须用大写字母开头.”,
“Bad constructor.”:“错误的构造对象”,
“Weird construction. Delete ‘new’.”:“构造对象有误,请删除’new’”,
“Missing ‘()’ invoking a constructor.”:“缺少括号()”,
“Avoid arguments.{a}.”:“避免参数.{a}.”,
“document.write can be a form of eval.”:“document.write是eval的一种形式”,
‘eval is evil.’:“尽量不要使用eval”,
“Math is not a function.”:“Math不是一个函数”,
“Missing ‘new’ prefix when invoking a constructor.”:“此处缺少了’new’”,
“Missing radix parameter.”:“缺少参数”,
“Implied eval is evil. Pass a function instead of a string.”:“传递一个函数,而不是一个字符串”,
“Bad invocation.”:“错误的调用”,
“['{a}'] is better written in dot notation.”:“['{a}']最好用点.的方式”,
“Extra comma.”:“多余的逗号”,
“Don’t make functions within a loop.”:“不要用循环的方式创建函数”,
“Unexpected parameter ‘{a}’ in get {b} function.”:“在{b}方法中不该用到参数’{a}’”,
“Duplicate member ‘{a}’.”:“重复的’{a}’”,
“Expected to see a statement and instead saw a block.”:“此处应该是语句声明.”,
“Too many var statements.”:“过多var的声明”,
“Redefinition of ‘{a}’.”:“‘{a}’被重复定义”,
“It is not necessary to initialize ‘{a}’ to ‘undefined’.”:“无需将’{a}’初始化为’undefined’”,
“Expected a conditional expression and instead saw an assignment.”:“此处需要一个表达式,而不是赋值语句”,
“Expected a ‘break’ statement before ‘case’.”:“在’case’之前需要有’break’.”,
“Expected a ‘break’ statement before ‘default’.”:“在’default’之前需要有’break’.”,
“This ‘switch’ should be an ‘if’.”:“此处’switch’应该是’if’.”,
“All ‘debugger’ statements should be removed.”:“请删除’debugger’的语句”,
“‘{a}’ is not a statement label.”:“‘{a}’不是一个声明标签.”,
“Expected an assignment or function call and instead saw an expression.”:“需要一个语句或者一个函数调用,而不是一个表达式”,
“Function declarations should not be placed in blocks. Use a function expression or move the statement to the top of the outer function.”:“函数的声明不能放在类似if的块中,需要放在外部函数的顶部.”
                    
        - 前端工程化
 - 架构总纲
 - 001
 - 美团技术架构
 - 前端工程化说明
 - 历史背景说明
 - 架构说明
 - 前端工程化技术栈
 - 技术文档说明
 - 功能模块说明
 - 前端模块管理器简介
 - 框架对比分析
 - vue&react&ng对比分析(一)
 - vue&react&ng对比分析(二)
 - vue&react&ng对比分析(三)
 - 工程化专题系列
 - 需要解决的问题
 - 001
 - 002
 - 003
 - 常见代码错误
 - jslint中常见的错误
 - css规范常见错误
 - html规范常见错误
 - 工程化目录
 - 工程化初始化
 - 项目构建流程
 - 项目打包优化
 - 上线与迭代注意事项
 - 前端部署发布
 - jetkins部署
 - 部署需求整理
 - 前端监控
 - 工程化实践指南
 - dock持续部署
 - 系列文章
 - 插拔式前端的设计
 - 其他实践
 - 工程化的前端管理
 - 宋小菜借鉴
 - 大前端团队介绍
 - 人员组成
 - 人员发展
 - 研发流程
 - 任务分类
 - 前端基础建设与架构
 - 技术栈以及技术方案
 - 业务目录大纲
 - 前端大纲
 - api管理
 - 后端api工具
 - 前端easymock
 - api拦截与代理
 - api优化
 - api请求时长策略设计
 - 前端架构专题
 - 架构专题一
 - 产品原型对接
 - 与ui对接
 - 图片专题
 - 图片工程化大纲
 - 图片优化
 - 图标字体
 - 图标字体vs雪碧图
 - 工程化的前端矩阵
 - 蚂蚁金服前端矩阵分享
 - BFF架构
 - 概念解析
 - 前端脚手架
 - 初始化项目
 - 个性化配置
 - 部署与发布
 - 性能优化专题
 - http专题
 - https常识
 - http优化1
 - http优化2
 - http优化3
 - http缓存
 - 常规web性能优化攻略
 - 性能优化大纲
 - 样式优化
 - js优化
 - 第三方依赖优化
 - 代码分割优化
 - 图片优化
 - 打包优化
 - 服务器优化
 - 缓存优化
 - 交互优化
 - pc事件优化
 - 手机事件优化
 - 推荐文章
 - 01
 - 前端安全专题
 - 前端安全大纲
 - 前端第三方库
 - seo优化
 - web框架的对比
 - 001
 - 学习资源
 - 珠峰前端架构
 - npm教程
 - npm入门
 - cnpm入门
 - cnpm搭建
 - 你该知道的js模块
 - browserSync
 - opn
 - js-cookie
 - npm-script进阶
 - 入门篇
 - 进阶篇
 - 高阶篇
 - 实践篇
 - yarn入门
 - nodejs教程
 - axios&&fetch
 - xhr
 - axios
 - fetch
 - babel专题
 - babel入门
 - profill入门
 - nodejs入门
 - 快速入门
 - 大纲介绍
 - node基础
 - global obj
 - assert断言
 - procss-进程
 - child_process子进程
 - cluster集群
 - console控制台
 - crypto-加密
 - dgram-数据报
 - dns-域名服务器
 - error-异常
 - events-事件
 - global-全局变量
 - http-基本协议
 - https-安全协议
 - modules-模块
 - os-操作系统
 - path-路径
 - querystring-查询字符串
 - readline-逐行读取
 - fs-文件系统
 - net-网络操作
 - 命令行工具
 - 内存泄露
 - 代码的组织与部署
 - 异步编程
 - orm模块
 - 异步编程解决方案
 - node-lessons
 - 环境准备
 - nodejs实践
 - 项目搭建
 - 异步优化
 - 创建web和tcp服务器
 - 终端问答程序
 - 爬虫系统
 - mongleDb
 - mongoDB简介
 - 基本使用
 - 实用技巧
 - 汇总001
 - 饿了么后台搭建
 - nodejs干货
 - 沪江基于node的实践
 - 苏宁基于nodejs优化
 - 基于nodejs开发脚手架
 - 书籍干货
 - 深入浅出nodejs
 - 异步I/O(一)
 - gulp教程
 - gulp入门
 - gulp常用插件(1)
 - gulp常用插件(2)
 - gulp创建目录
 - 经验普及贴
 - webpack教程
 - webpack入门
 - 简单入门
 - entry配置
 - output配置
 - 插件使用01
 - 插件使用02
 - loader使用
 - dev-server介绍
 - 构建css
 - css模块化
 - 使用less和sass
 - 构建图片
 - 引入字体
 - babel配置攻略
 - eslint
 - 001
 - webpack进阶
 - 分不同文件检出
 - 优化打包大小
 - 优化打包速度
 - 自定义配置
 - 单页以及多页如何配置
 - 优化实践
 - 文章导读
 - 001
 - 优化指南
 - 参考列表
 - webpack4
 - 多入口程序构建
 - 参考教程
 - 项目实践
 - 环境区分
 - 常见问题
 - 解读webpack
 - 从vuejs权威指南中解决
 - 深入浅出webpack
 - rollup
 - 入门
 - parcel
 - 入门篇
 - express教程
 - nuxt教程
 - 入门
 - 基本入门
 - koa教程
 - koa基本入门
 - koa开发注意事项
 - koa实践指南
 - 关于路由
 - koa优化指南
 - 001
 - Vuejs
 - vuejs入门系列
 - vue-cli入门
 - vue2基本认识
 - vuejs入门教程
 - 样式绑定
 - vuex入门学习笔记
 - vue组件生命周期
 - 组件的使用
 - vue-router入门
 - vue-filter
 - 计算属性使用
 - 开发注意事项
 - mixins
 - 组件通讯
 - vuejs进阶
 - 进阶资源
 - router进阶
 - 官网介绍
 - 前进与后退优化
 - keep-alive基本使用
 - keep-alive原理详解
 - 钩子函数进阶
 - 计算属性&监听&方法
 - vue服务端渲染技术
 - 项目实践之路
 - 实践大纲
 - 插槽专题篇
 - vue-cli升级
 - 进阶入门
 - vuejs架构
 - nuxt
 - vuejs项目实践
 - vue实践常见问题
 - 001
 - 002
 - 003
 - 004
 - 005
 - 改造api参数探索
 - 007
 - 008
 - 009
 - 010
 - 项目技术栈
 - vue性能问题以及优化方案
 - vue-spa应用的理解
 - vue-ssr的部署与使用
 - 滴滴出行实践案例
 - 2.0重构
 - vue-element-admin实践
 - 准备工作
 - 菜单设计
 - 权限设计
 - 依赖模块
 - vue-betterScroll
 - 性能优化懒加载
 - 京东组件实践
 - vue2项目小结
 - vue探索与实践
 - 去哪实践
 - 介绍
 - 饿了么项目实践
 - 项目解析
 - vue骨架屏实践
 - vue生态推荐
 - ui框架
 - elementUI
 - 001
 - 002
 - VUE-material
 - vant-ui
 - 解读入门
 - iview
 - 使用问题汇总
 - vux
 - mint-ui
 - loadmore
 - vue资源导航
 - vueconf
 - 源码解读
 - vm
 - 双向绑定
 - 基本原理
 - 数组双向绑定
 - 报错机制
 - 封装方法
 - 运行环境
 - 入门
 - 指令
 - vue-router解读
 - util
 - vue-props
 - 流程逻辑
 - 推荐文章
 - 源码解读
 - 文章导读
 - 001
 - vuejs实战
 - 基础篇
 - 进阶篇
 - 实践篇
 - 面试专题
 - angularjs教程
 - angularjs入门系列
 - 基本入门
 - ng2入门
 - ng进阶
 - ng项目实践
 - 源码解读
 - typescript
 - reactjs教程
 - reactjs入门系列
 - react的基本入门
 - react组件
 - virtalDom认识
 - react-cli入门
 - react组件的生命周期
 - 基本知识点
 - react-router教程
 - react进阶
 - 基本实践
 - react加载性能优化指南
 - react属性封装
 - 进阶45讲
 - 01概述
 - 02jsx
 - 06高阶组件&函数子组件
 - contextApi
 - react-router
 - 入门章节
 - 进阶
 - 高阶组件
 - react进阶组件
 - 基本介绍
 - render props
 - render props的封装
 - render props getter
 - react-native入门
 - 源码解读
 - 001
 - 002-reactDemo
 - 参考教程
 - 参考教程1
 - 了解react-hooks
 - ui框架
 - pc端ui框架推荐
 - 项目实践
 - weatherApp
 - 001
 - 002
 - 不同生命周期使用场景
 - react项目结构和组件的命名
 - 常见问题解答
 - 参考书籍
 - react全栈
 - 前言
 - react与redux进阶
 - 常见误解
 - 反模式
 - react设计模式与最佳实践
 - 7美化组件
 - 7.2行内样式
 - 7.4css模块
 - 深入react技术栈
 - react学习手册
 - 序
 - mobx教程
 - 入门
 - 大佬推荐
 - 001
 - react面试
 - 001
 - linux教程
 - linux入门
 - 基本入门
 - 文件管理
 - 文件传输
 - 文档编辑
 - 磁盘管理
 - 磁盘维护
 - 网络通讯
 - 系统管理
 - 系统设置
 - 备份压缩
 - 设备管理
 - 查看系统信息
 - linux其他
 - webhook
 - rsync入门教程
 - ssh免登陆设置
 - 安装nodejs
 - nginx教程
 - 入门教程
 - 安装
 - 基本配置
 - 服务基本使用
 - 高性能nginx
 - 001
 - pm2教程
 - shell教程
 - 入门大纲
 - echo命令
 - 参考文献
 - linux常用命令2
 - linux常见问题
 - 001
 - python
 - 入门教程
 - 机器学习
 - 准备工作
 - 服务器常识
 - tomcat
 - 入门常识
 - iis
 - redis教程
 - 入门第一篇
 - redis进阶
 - 项目实践
 - redis使用问题
 - mongleDB
 - 入门
 - 使用进阶
 - 项目实践
 - 常见问题
 - electron
 - 入门系列
 - 前言
 - 小程序
 - 入门
 - 准备工作
 - 路由
 - 参考文档
 - 001
 - 小程序开发--双路视频调研
 - 准备工作
 - 参考资源
 - 参考网址
 - docker
 - 入门
 - 基本认识
 - 安装与使用
 - docker安装nginx
 - docker安装jetkins(1)
 - docker部署jenkins(2)
 - 进阶
 - 实践总结
 - docker群分享
 - docker部署前端应用
 - 文章导读
 - docker其他
 - 网络安全
 - 入门
 - 大纲
 - 项目解析
 - schoolpal.web
 - 功能模块大纲
 - 目录结构大纲
 - 前端国际化
 - 国际化方案
 - 其他
 - bower入门教程
 - weex
 - 入门
 - memcached
 - 入门
 - sails
 - 入门
 
