ECMAScript 5 特性和ECMAScript 6

ECMAScript 5 特性
这些是 2009 年发布的新特性:

"use strict" 指令
String.trim()
Array.isArray()
Array.forEach()
Array.map()
Array.filter()
Array.reduce()
Array.reduceRight()
Array.every()
Array.some()
Array.indexOf()
Array.lastIndexOf()
JSON.parse()
JSON.stringify()
Date.now()


=================================================================、
ECMAScript 6 是什么?
ECMAScript 6 也称为 ES6 和 ECMAScript 2015。

一些人把它称作 JavaScript 6。

本章介绍 ES6 中的一些新特性。

JavaScript let
JavaScript const
幂 (**)
默认参数值
Array.find()
Array.findIndex()
===================

es6新增特性
1.let和const关键字
2.解构赋值
3.箭头函数
4.模板字符串:使用反引号``代替双引号创建字符串
5.标签模板
6.扩展运算符
7.新增了一些字符串和数组方法
8.Symbol
9.迭代器(Iterator)
10.生成器
11.Promise承诺

https://github.com/lixinlin123a/mimi.git
-----------------------------
vue.config.js
const { defineConfig } = require('@vue/cli-service')
module.exports = defineConfig({
  transpileDependencies: true,
  // /01这种方式好像不行,不知道什么原因
  // devServer: {
  //   proxy: {
  //     '/api': { // /api :表示拦截以/api开头的请求路径
  //       // target: '<url>', // 跨域的域名(不需要写路径)
  //       // 'https://www.vue-js.com/api/v1/topics', //完整地址
  //       target: 'https://www.vue-js.com/api', // 跨域的域名(不需要写路径)
  //       // ws: true, // 是否代理websocked
  //       changeOrigin: true, // 是否开启跨域
  //       pathRewrite: { // 重写路径
  //         '^api': '' // 把/api变为空字符串
  //       }
  //     }
  //   }
  // }
  // /02这种方式可以解决跨域
  devServer: {
    proxy: {
      '/api': { // /api :表示拦截以/api开头的请求路径
        // target: '<url>', // 跨域的域名(不需要写路径)
        // 'https://www.vue-js.com/api/v1/topics', //完整地址
        target: 'https://www.vue-js.com', // 跨域的域名(不需要写路径)
        // ws: true, // 是否代理websocked
        changeOrigin: true // 是否开启跨域
        // pathRewrite: { // 重写路径
        //   '^api': '' // 把/api变为空字符串
        // }
      }
    }
  }
})
 

  • 11
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值