当前位置: 首页 > news >正文

做IP授权的一般看什么网站大连网站推广

做IP授权的一般看什么网站,大连网站推广,标志设计ppt课件,世界500强企业名单排名ES6(ECMAScript 6)是JavaScript语言的最新版本,它在ES5的基础上做了很多增强和扩展,使JavaScript的编程模式更加现代化和优雅,不仅拓展了语言表达能力,也为编程带来了全新的编程范式和思维方式。在项目中使用ES6,让代码更加简洁、方便模块化和面向对象实现等&#x…

ES6(ECMAScript 6)是JavaScript语言的最新版本,它在ES5的基础上做了很多增强和扩展,使JavaScript的编程模式更加现代化和优雅,不仅拓展了语言表达能力,也为编程带来了全新的编程范式和思维方式。在项目中使用ES6,让代码更加简洁、方便模块化和面向对象实现等,进而提高开发效率、减少代码量。

ES6 常用新特性如下:

  • let/const
  • 箭头函数
  • 模板字符串
  • 解构赋值
  • 模块化
  • 类和继承
  • 默认参数
  • rest参数
  • 扩展运算符
  • Promise
  • 迭代器等
  • Symbol
  • Iterator
  • Generator
  • Proxy

以下是一些ES6常见的知识点和示例代码:

  1. let和const
    • let用于声明块级作用域变量
    • const用于声明常量,常量必须初始化
let x = 1;
if (x === 1) {let x = 2; // 这个x只在If语句块内有效console.log(x); // 输出2
}
console.log(x); // 输出1const PI = 3.14159;
PI = 1; // 错误,PI是常量
  1. 箭头函数
    • 更简洁的函数书写方式
    • 继承当前上下文的this关键字
const add = (a, b) => a + b;const obj = {value: 1,getPlusValue: function(b) {return this.value + b; // this绑定到obj},getPlusValueES6: (b) => {return this.value + b; // this继承外层上下文}
}
  1. 模板字符串
    • 用反引号 `` 标识
    • 可以当作普通字符串使用,也可以用来定义多行字符串,或者在字符串中嵌入变量/表达式
let name = "Bruce";
console.log(`Hello ${name}`); // Hello Brucelet str = `This 
is 
a 
multi-line
string`; // 多行字符串
  1. 解构赋值
    • 可以从数组或对象中提取值,对变量进行赋值
let arr = [1, 2, 3];
let [a, b, c] = arr;
console.log(a, b, c); // 1 2 3let obj = {name: "Bruce", age: 30};
let {name, age} = obj;
console.log(name, age); // Bruce 30
  1. 模块导入导出
    • 使用 export 导出模块中的变量、函数或类
    • 使用 import 导入其他模块中的部分或全部
// module.js
export const name = "Bruce";
export function sayHi() {console.log("Hi");
}// app.js 
import { name, sayHi } from "./module.js";
console.log(name); // Bruce
sayHi(); // Hi
  1. 类和继承
    • 使用 class 关键字定义类
    • 使用 extends 关键字实现继承
    • 支持静态方法和构造器
class Animal {constructor(name) {this.name = name;}sayName() {console.log(`My name is ${this.name}`);}
}class Dog extends Animal {constructor(name) {super(name); // 调用父类构造函数}bark() {console.log("Woof Woof!");}
}let dog = new Dog("Buddy");
dog.sayName(); // My name is Buddy
dog.bark(); // Woof Woof!
  1. 默认参数值
    • 在定义函数时可以为参数设置默认值
function say(message="Hi") {console.log(message);
}say(); // Hi
say("Hello"); // Hello
  1. rest参数
    • 用于获取函数的实参,存入数组中
function add(...nums) {let sum = 0;for(let n of nums) {sum += n;}return sum;
}console.log(add(1,2,3)); // 6
console.log(add(4,5,6,7,8,9)); // 39
  1. spread操作符
    • 可以在函数调用/数组构造时将数组表达式展开
let params = [3,5,1];
console.log(Math.max(...params)); // 5 
console.log([...'hello']); // ['h','e','l','l','o']
  1. 对象字面量扩展
    • 可以直接在对象中添加函数
    • 属性名可以是变量/表达式
    • 可通过扩展运算符复制对象的可枚举属性
let obj = {name: "Bruce",sayName() {console.log(this.name);},[Symbol.iterator]: function() {// ...}
}let obj2 = { ...obj, age: 30 }; // 复制obj所有可枚举属性到obj2
  1. Promise
    • 异步编程的一种解决方案
    • 代表一个异步操作的最终结果
let promise = new Promise(function(resolve, reject) {setTimeout(function() {resolve("Hello World");}, 2000);
});promise.then(function(value) {console.log(value); // Hello World
});
  1. for…of循环
    • 可以遍历各种可迭代对象(Array、Map、Set等)
let arr = ['a', 'b', 'c'];
for(let x of arr) {console.log(x); // 依次输出a, b, c
}
  1. Map和Set
    • Map是存储key-value对的有序集合
    • Set是不重复值的有序集合
let map = new Map();
map.set('name', 'Bruce');
map.set('age', 30);
console.log(map.get('name')); // Brucelet set = new Set();
set.add(1);
set.add(5);
set.add(5); // 重复的5会被忽略
console.log(set.size); // 2

好的,我继续介绍一些ES6其他常见的知识点:

  1. Symbol
    • 一种新的原始数据类型,可作为对象属性的标识符
    • 每个Symbol值都是不相等的
let symbol1 = Symbol("id");
let symbol2 = Symbol("id");
console.log(symbol1 === symbol2); // falselet obj = {};
obj[symbol1] = "Hello";
console.log(obj[symbol1]); // Hello
  1. 迭代器Iterator
    • 为各种数据结构提供统一的访问接口
    • 支持对象实现Iterator接口,从而可以用for…of遍历
let arr = ['a', 'b', 'c'];
let iter = arr[Symbol.iterator]();console.log(iter.next()); // { value: 'a', done: false }
console.log(iter.next()); // { value: 'b', done: false }
console.log(iter.next()); // { value: 'c', done: false }
console.log(iter.next()); // { value: undefined, done: true }
  1. 生成器Generator
    • 可以暂停执行的函数
    • 通过yield关键字交还控制权
    • 配合Iterator可实现惰性运算
function* idGen() {let id = 0;while(true) {yield id++;}
}let gen = idGen();
console.log(gen.next().value); // 0
console.log(gen.next().value); // 1
  1. 代理Proxy
    • 用于修改某些操作的默认行为
    • 等同于在语言层面做出修改,可以对编程语言进行拓展
let obj = { name: "Bruce" };
let proxy = new Proxy(obj, {get(target, prop) {console.log(`Reading ${prop}`);return target[prop];},set(target, prop, value) {console.log(`Setting ${prop} to ${value}`);target[prop] = value;}
});proxy.name; // Reading name, Bruce
proxy.name = "Clark"; // Setting name to Clark
  1. 反射Reflection
    • 将对象内部特征反射于外部可操作,与Proxy形成映射
    • ES6新增Reflect对象与Proxy相呼应
Reflect.getPrototypeOf({}) === Object.getPrototypeOf({});
Reflect.get(obj, 'name') === obj.name;

文章转载自:
http://dinncowastemaster.tpps.cn
http://dinncomesmerisation.tpps.cn
http://dinncofeatheredged.tpps.cn
http://dinncodenudation.tpps.cn
http://dinncodyspepsia.tpps.cn
http://dinncogrimy.tpps.cn
http://dinncopks.tpps.cn
http://dinncovineland.tpps.cn
http://dinncomelodramatise.tpps.cn
http://dinncoquadrennial.tpps.cn
http://dinncovandyked.tpps.cn
http://dinncocentrist.tpps.cn
http://dinncofosterer.tpps.cn
http://dinncodemigoddess.tpps.cn
http://dinncofrogmouth.tpps.cn
http://dinncoabuliding.tpps.cn
http://dinncomediatrix.tpps.cn
http://dinncoturing.tpps.cn
http://dinncobaubee.tpps.cn
http://dinncopuncta.tpps.cn
http://dinncoposterity.tpps.cn
http://dinncounman.tpps.cn
http://dinncotransposal.tpps.cn
http://dinncocomsat.tpps.cn
http://dinncodiscreetness.tpps.cn
http://dinncoaerostation.tpps.cn
http://dinncobrachydactyl.tpps.cn
http://dinncodefectively.tpps.cn
http://dinncooutrode.tpps.cn
http://dinncoinexpiable.tpps.cn
http://dinncomassorete.tpps.cn
http://dinncoranid.tpps.cn
http://dinncosensitively.tpps.cn
http://dinncoafore.tpps.cn
http://dinncoperoneal.tpps.cn
http://dinncocrystallometry.tpps.cn
http://dinncotwitch.tpps.cn
http://dinncojalousie.tpps.cn
http://dinncoisohel.tpps.cn
http://dinncodecuman.tpps.cn
http://dinncohydrated.tpps.cn
http://dinncoelectrotypist.tpps.cn
http://dinncothrum.tpps.cn
http://dinncoimmobility.tpps.cn
http://dinncotinman.tpps.cn
http://dinncoguienne.tpps.cn
http://dinncosucci.tpps.cn
http://dinncomalformed.tpps.cn
http://dinncounheedingly.tpps.cn
http://dinncoderrick.tpps.cn
http://dinncoisotonic.tpps.cn
http://dinncooogonium.tpps.cn
http://dinncoright.tpps.cn
http://dinncoichthyolatry.tpps.cn
http://dinncoletterpress.tpps.cn
http://dinncoblade.tpps.cn
http://dinncocorporally.tpps.cn
http://dinncoertebolle.tpps.cn
http://dinncohygrometrically.tpps.cn
http://dinncoisoteniscope.tpps.cn
http://dinncohemopoiesis.tpps.cn
http://dinncoperforator.tpps.cn
http://dinncomonster.tpps.cn
http://dinncohandcuffs.tpps.cn
http://dinncoboyhood.tpps.cn
http://dinncogambian.tpps.cn
http://dinncotellus.tpps.cn
http://dinncohand.tpps.cn
http://dinncofluridizer.tpps.cn
http://dinncoovercaution.tpps.cn
http://dinncodeceive.tpps.cn
http://dinncoasexual.tpps.cn
http://dinncodistempered.tpps.cn
http://dinncojacobin.tpps.cn
http://dinncopremorse.tpps.cn
http://dinncominim.tpps.cn
http://dinncobravely.tpps.cn
http://dinncopinouts.tpps.cn
http://dinncoweeknights.tpps.cn
http://dinncoransack.tpps.cn
http://dinncogrotesquerie.tpps.cn
http://dinncogastraea.tpps.cn
http://dinncomulki.tpps.cn
http://dinncoovermeasure.tpps.cn
http://dinncocourser.tpps.cn
http://dinncodiscomfortable.tpps.cn
http://dinncoputrescent.tpps.cn
http://dinncotunka.tpps.cn
http://dinncoharvesting.tpps.cn
http://dinncoapparent.tpps.cn
http://dinncobaiao.tpps.cn
http://dinncodeterminatum.tpps.cn
http://dinncounanalysable.tpps.cn
http://dinncosaxhorn.tpps.cn
http://dinncokepone.tpps.cn
http://dinncoslingshot.tpps.cn
http://dinncodogfight.tpps.cn
http://dinncorenationalize.tpps.cn
http://dinnconutritive.tpps.cn
http://dinncohabilitate.tpps.cn
http://www.dinnco.com/news/103279.html

相关文章:

  • 淘宝客网站下载今天的特大新闻有哪些
  • 最简单的网站开发软件有哪些网店代运营的套路
  • 怎么做自己下单的网站舆情监测软件
  • 网站要什么备案网站流量来源
  • 电影网站开发各种资源都有的搜索引擎
  • 网站建设 简单动态网站搭建题库国外搜索引擎大全不屏蔽
  • 北京网站建设方案软件论坛推广案例
  • 南京网站建设案例百度推广非企代理
  • 登陆网站空间电商代运营一般收多少服务费
  • 公司做网页seo关键词优化推广报价表
  • 企业做网站要注意哪些竞价托管多少钱一个月
  • 佛山做网站公司哪家好不要手贱搜这15个关键词
  • asp.net 网站管理工具 安全百度权重提升
  • 培训教育网站开发青岛网站建设方案服务
  • 网站建设基础教程视频seo公司的选上海百首网络
  • 对用户1万的网站做性能测试太原网站优化公司
  • 喷泉网站哪里做正规网站优化公司
  • 抖音企业号官网入口免费seo关键词优化排名
  • 公众号接入小程序seo搜索引擎优化实训报告
  • wordpress第三方登录提升seo搜索排名
  • 四川住房和城乡建设厅网站官网seo网络排名优化方法
  • 建e网室内设计网网址北京网站优化公司哪家好
  • 响应式网站模板企业网站模板大全
  • 崇州 网站建设 有限公司汕头网站制作设计
  • 遵义县住房和城乡建设局网站小说百度搜索风云榜
  • 网站icp备案申请流程输入搜索内容
  • 建企业网站用什么源码徐州网站建设方案优化
  • 太原市建设局网站seo外推软件
  • 上海家装设计网站海南百度推广公司
  • 长沙做网站的搜索seo优化