js中export的问题
在JS中 定义一个函数名字是export 会报错(ff不报错,ie会),修改成其他名字就行了。
原因是,export是ECMA为将来保留的词(Words reserved for ECMA extensions)。
下面把OReilly.JavaScript.The.Definitive.Guide.5th.Edition
2.8. Reserved Words的内容: |
JavaScript has a number of reserved keywords. These are words that you cannot use as identifiers (variable names, function names, and loop labels) in your JavaScript programs. Table 2-1 lists the keywords standardized by ECMAScript v3. These words have special meaning to JavaScript; they are part of the language syntax itself.
Table 2-1. Reserved JavaScript keywords
break
do
if
switch
typeof
case
else
in
this
var
catch
false
instanceof
tHRow
void
continue
finally
new
true
while
default
for
null
try
with
delete
function
return
Table 2-2 lists other reserved keywords. These words are not currently used in JavaScript, but they are reserved by ECMAScript v3 as possible future extensions to the language.
Table 2-2. Words reserved for ECMA extensions
abstract
double
goto
native
static
boolean
enum
implements
package
super
byte
export
import
private
synchronized
char
extends
int
protected
throws
class
final
interface
public
TRansient
const
float
long
short
volatile
debugger
In addition to some of the formally reserved words just listed, current drafts of the ECMAScript v4 standard are contemplating the use of the keywords as, is, namespace, and use. Current JavaScript interpreters will not prevent you from using these four words as identifiers, but you should avoid them anyway.
[*] See the Window object in Part IV for a list of the additional global variables and functions defined by client-side JavaScript.
Table 2-3. Other identifiers to avoid
arguments
encodeURI
Infinity
Object
String
Array
Error
isFinite
parseFloat
SyntaxError
Boolean
escape
isNaN
parseInt
TypeError
Date
eval
Math
RangeError
undefined
decodeURI
EvalError
NaN
ReferenceError
unescape
decodeURIComponent
Function
Number
RegExp
URIError
转载于:https://www.cnblogs.com/ainiaa/archive/2011/03/25/1995778.html
js中export的问题相关推荐
- JS中export怎么用
一.export 用法 有两种不同的导出方式:命名导出和默认导出.命名导出可以导出多个接口,而默认导出,只能导出一个. 1.命名导出: 导入时,必须使用导出接口的名字. // 导出事先定义的特性 ex ...
- import export php,import与export在node.js中的使用方法
import与export是es6中模块化的导入与导出,node.js现阶段不支持,需要通过babel进行编译,使其变成node.js的模块化代码.(关于node.js模块,可参考其他node.js模 ...
- JS ES6中export和import详解
1.Export 模块是独立的文件,该文件内部的所有的变量外部都无法获取.如果希望获取某个变量,必须通过export输出, // profile.js export var firstName = ' ...
- JS 中的 import 与 export
模块 模块就是实现特定功能的一组方法. 理想情况下,开发者只需要实现核心的业务逻辑,其他都可以加载别人已经写好的模块.但是,JavaScript 不是一种模块化编程语言,在 ES6 以前,它是不支持类 ...
- node.js中模块_在Node.js中需要模块:您需要知道的一切
node.js中模块 by Samer Buna 通过Samer Buna 在Node.js中需要模块:您需要知道的一切 (Requiring modules in Node.js: Everythi ...
- thymeleaf加载不了js引用_web前端教程之js中的模块化一
web前端教程之js中的模块化一:我们知道最常见的模块化方案有CommonJS.AMD.CMD.ES6,AMD规范一般用于浏览器,异步的,因为模块加载是异步的,js解释是同步的,所以有时候导致依赖还没 ...
- vue样式 引入图片_详解Vue.js中引入图片路径的几种方式
vue --version 3.6.3 记录总结一下的Vue中引入图片路径的几种书写方式 vue中静态资源的引入机制 Vue.js关于静态资源的官方文档 静态资源可以通过两种方式进行处理: 在 Jav ...
- java配置接口提供给vue,vue在js中配置全局API接口
在src文件夹中新建util文件夹,然后在新建一个globalAPI.js文件. 在js中配置后端的接口数据 const http = 'http://127.0.0.1:8989' const gl ...
- vue中引用js_从JS中的内存管理说起 —— JS中的弱引用
点击上方"蓝字"关注本公众号 写在前面 在所有的编程语言中,我们声明一个变量时,需要系统为我们分配一块内存.当我们不再需要这个变量时,需要将内存进行回收(这个过程称之为垃圾回收). ...
最新文章
- Linux中look命令,如何在Linux上使用look命令 | MOS86
- oracle 输出重复记录,ORACLE 去除重复记录
- 【错误记录】Android Studio 创建 Flutter 应用被卡住 ( 更新 Flutter 插件 | 命令行创建 | 断网 )
- Linux搭建私有Git服务器以及ssh免密登陆配置
- 数据结构_排序算法总结
- qt mysql 系统时间_使用QT和参数在SQLite数据库中插入日期时间
- 一? ilkkn.n_IL&FS的完整形式是什么?
- VMware10安装centos6.5(64位)
- 20200812每日一句
- 微分方程的数值解法与程序实现 pdf_数值计算方法·第三部分
- Windows下hadoop配置
- 推荐10个 Chrome 插件
- 线性代数学习笔记——第二十四讲——向量及其线性运算
- 【文印技巧】明明选了黑白打印,却印出了棕红色,怎么解决?
- RT-Thread柿饼的控件简介
- 计算机网络(三)—— 数据链路层(1):数据链路层概述
- JAVA萌新学习day17.18天 数据库MySQL
- Scala-scalaMap转JSON字符串和javaMap
- PDPS教程:机器人气动点焊焊枪大开与小开运动状态自动切换设置
- 有史以来最全面最经典的网络技术资料合集
热门文章
- 查看服务器ip配置信息失败,U-Center 纳管戴尔的服务器报错“报错获取厂商信息失败,请确认IP、用户名、密码 、厂商、协议与配置文件是否正确”...
- spring配置文件约束
- 电位器替换遥控器做远程遥控方案,远程控制云台方案
- 敢死队核心:{买了就涨指标}
- SpringBoot实战(八):集成Swagger
- 计算机中那些事儿(二):如何神操作你的电脑
- Google发布超难问答数据集「自然问题」:30万对问答,BERT都达不到70分
- 2018中国年度AI评选揭晓!10大领航企业,50家明星公司,10佳投资机构
- 自动驾驶“老司机”拼车技,MIT的这个比赛已经飙到了时速123公里
- 一文看尽苹果WWDC大会:今年有亮点,但都不“硬”