Min's blog

I choose to see the beauties in the world.

导航

ES6

Posted on 2017-11-16 10:20  Min77  阅读(84)  评论(0编辑  收藏  举报

let  变量声明:  只在声明的代码块内有效,不允许重复声明

const 声明变量,但是声明的是常量,必须赋值, 一旦赋值,常量的值就不能改变, 只在当前代码块有效,不允许重复声明,如声明对象,对象内部数据变化与外部无关

 

Traceur转码器
<!-- 加载Traceur编译器 -->
<script src="http://google.github.io/traceur-compiler/bin/traceur.js" type="text/javascript"></script>
<!-- 将Traceur编译器用于网页 -->
<script src="http://google.github.io/traceur-compiler/src/bootstrap.js" type="text/javascript"></script>
<!-- 打开实验选项,否则有些特性可能编译不成功 -->
<script>
        traceur.options.experimental = true;
</script>

babel转码