一、在网页上使用
若浏览器已经支持,则不需要引入
<!-- 加载Traceur编译器 -->
<script src="traceur.js" type="text/javascript"></script>
<!-- 将Traceur编译器用于网页 -->
<script src="bootstrap.js" type="text/javascript"></script>
<!-- 打开实验选项,否则有些特性可能编译不成功 -->
<script>
traceur.options.experimental =true;
</script>
<script type="module">
</script>
二、在线编译
三、直接在node里面使用
直接用,代码开始添加'use strict'
运行时,node --harmony_desctructuring xxx.js