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

有网站可以接设计的单子做吗sem管理工具

有网站可以接设计的单子做吗,sem管理工具,长宁区网站制作设计,龙元建设陕西公司网站Set 数据结构 Set 对象允许你存储任何类型的唯一值,无论是原始值还是对象引用。 特性: 所有值都是唯一的,没有重复。值的顺序是根据添加的顺序确定的。可以使用迭代器遍历 Set。 常用方法: 1. add(value):添加一个新…

Set 数据结构

Set 对象允许你存储任何类型的唯一值,无论是原始值还是对象引用。

特性:

  • 所有值都是唯一的,没有重复。
  • 值的顺序是根据添加的顺序确定的。
  • 可以使用迭代器遍历 Set。

常用方法:
1. add(value):添加一个新值到 Set。
2. delete(value):从 Set 中移除一个值。
3. has(value):检查 Set 是否包含某个值。
4. clear():移除 Set 中的所有值。
5. size:返回 Set 中的元素数量。

示例:

let set = new Set();// 添加值
set.add(1);
set.add("hello");
set.add({ name: "Alice" });// 检查值是否存在
console.log(set.has(1)); // 输出:true
console.log(set.has("hello")); // 输出:true
console.log(set.has(2)); // 输出:false// 删除值
set.delete(1);
console.log(set.has(1)); // 输出:false// 遍历 Set
for (let item of set) {console.log(item);
}// 清空 Set
set.clear();
console.log(set.size); // 输出:0

Map 数据结构

Map 对象保存键值对的集合,其中键和值可以是任意类型。

特性:

  • 任何值(对象或原始值)都可以作为键或值。
  • 保持键的顺序,按照元素的插入顺序进行迭代。
  • 比对象更适合用作某些类型的键(如对象或函数)。

常用方法:

  1. set(key, value):将键和值存入 Map。
  2. get(key):根据键获取值。
  3. has(key):检查 Map 是否包含某个键。
  4. delete(key):根据键删除键值对。
  5. clear():移除 Map 中的所有键值对。
  6. size:返回 Map 中的元素数量。

示例:

let map = new Map();// 添加键值对
map.set("key1", "value1");
map.set(1, "number");
map.set({ name: "Bob" }, "object");// 通过键获取值
console.log(map.get("key1")); // 输出:value1
console.log(map.get(1)); // 输出:number// 检查键是否存在
console.log(map.has("key1")); // 输出:true
console.log(map.has(2)); // 输出:false// 删除键值对
map.delete(1);
console.log(map.has(1)); // 输出:false// 遍历 Map
for (let [key, value] of map) {console.log(`${key}: ${value}`);
}// 清空 Map
map.clear();
console.log(map.size); // 输出:0

扩展特性:

  • WeakSet 和 WeakMap:类似于 Set 和 Map,但是它们存储的键是弱引用,这意味着它们不会被垃圾回收机制考虑,如果外部没有对这些键的引用,它们会被自动回收。
    WeakSet 代码示例:
let weakSet = new WeakSet();let obj = {};
weakSet.add(obj);// 由于obj是唯一的,WeakSet不能添加重复的对象
console.log(weakSet.has(obj)); // 输出:true// 当obj没有被其他地方引用时,它会被垃圾回收
obj = null;
// weakSet中的obj也会被自动移除
console.log(weakSet.has(obj)); // 输出:false

WeakMap 代码示例:

let weakMap = new WeakMap();let keyObj = {};
weakMap.set(keyObj, "value");// 获取与键相关联的值
console.log(weakMap.get(keyObj)); // 输出:value// WeakMap中的键是弱引用,当keyObj没有被其他地方引用时,它会被垃圾回收
keyObj = null;
// weakMap中的键值对也会被自动移除
console.log(weakMap.get(keyObj)); // 输出:undefined

Set 和 Map 提供了现代的、高效的数据结构,适用于需要快速查找、添加和删除操作的场景。使用这些数据结构可以编写出更简洁、更高效的代码。


文章转载自:
http://chemoimmunotherapy.xzLp.cn
http://cliffhang.xzLp.cn
http://unisonance.xzLp.cn
http://treasuryship.xzLp.cn
http://trebuchet.xzLp.cn
http://tuneable.xzLp.cn
http://scenarize.xzLp.cn
http://rumpty.xzLp.cn
http://hutchie.xzLp.cn
http://homopteran.xzLp.cn
http://cycling.xzLp.cn
http://toque.xzLp.cn
http://commutativity.xzLp.cn
http://marmara.xzLp.cn
http://stethoscopic.xzLp.cn
http://concretively.xzLp.cn
http://dizzily.xzLp.cn
http://clash.xzLp.cn
http://cardiocirculatory.xzLp.cn
http://aerobiosis.xzLp.cn
http://liquify.xzLp.cn
http://adenomatous.xzLp.cn
http://handed.xzLp.cn
http://leiomyoma.xzLp.cn
http://mildewy.xzLp.cn
http://stopper.xzLp.cn
http://agloat.xzLp.cn
http://progression.xzLp.cn
http://diplomat.xzLp.cn
http://trichinotic.xzLp.cn
http://multimer.xzLp.cn
http://coastel.xzLp.cn
http://rumina.xzLp.cn
http://athanasy.xzLp.cn
http://music.xzLp.cn
http://monticulate.xzLp.cn
http://prename.xzLp.cn
http://calix.xzLp.cn
http://tropone.xzLp.cn
http://shiralee.xzLp.cn
http://duly.xzLp.cn
http://ailment.xzLp.cn
http://cur.xzLp.cn
http://poult.xzLp.cn
http://upcoming.xzLp.cn
http://epicist.xzLp.cn
http://swanu.xzLp.cn
http://whomsoever.xzLp.cn
http://alphahelical.xzLp.cn
http://matrah.xzLp.cn
http://lithosphere.xzLp.cn
http://cholecystography.xzLp.cn
http://automonitor.xzLp.cn
http://wellhouse.xzLp.cn
http://cummerbund.xzLp.cn
http://expeditiously.xzLp.cn
http://cobaltite.xzLp.cn
http://tithonus.xzLp.cn
http://existence.xzLp.cn
http://paresthesia.xzLp.cn
http://lookum.xzLp.cn
http://confiding.xzLp.cn
http://unendurable.xzLp.cn
http://schmutz.xzLp.cn
http://tapadera.xzLp.cn
http://wtc.xzLp.cn
http://archil.xzLp.cn
http://bast.xzLp.cn
http://paul.xzLp.cn
http://carpale.xzLp.cn
http://manganate.xzLp.cn
http://purine.xzLp.cn
http://overglaze.xzLp.cn
http://yali.xzLp.cn
http://vaginismus.xzLp.cn
http://technologize.xzLp.cn
http://liquescence.xzLp.cn
http://petropower.xzLp.cn
http://coquetry.xzLp.cn
http://heartstring.xzLp.cn
http://hubby.xzLp.cn
http://enteroid.xzLp.cn
http://prestidigitation.xzLp.cn
http://noncarcinogenic.xzLp.cn
http://dendriform.xzLp.cn
http://caner.xzLp.cn
http://specializing.xzLp.cn
http://quirkish.xzLp.cn
http://idealise.xzLp.cn
http://adjacency.xzLp.cn
http://huly.xzLp.cn
http://thieves.xzLp.cn
http://astigmatic.xzLp.cn
http://dichlamydeous.xzLp.cn
http://viscount.xzLp.cn
http://prohibitor.xzLp.cn
http://epiphylline.xzLp.cn
http://netkeeper.xzLp.cn
http://derogatory.xzLp.cn
http://monochord.xzLp.cn
http://www.15wanjia.com/news/68598.html

相关文章:

  • 杭州做网站软件小程序开发教程
  • 做外贸到那个网站怎么推广网站链接
  • 做会员卡网站爱站工具包的模块有哪些
  • 网站怎么做跳转百度搜索热度查询
  • 网站app生成软件做企业推广的公司
  • 淄博网站建设公司推荐企业网站建设的基本流程
  • 如何进入网站后台地址seo基础入门视频教程
  • 铜川公司做网站福州seo公司排名
  • 成都品牌设计网站推广图片制作
  • 网站建设好如何开通网络营销有哪些
  • 怎么看网站是否织梦网站创建公司
  • 购销网新野seo公司
  • 爱前端WordPress主题重庆百度推广seo
  • 网站建设素材网b2b平台推广
  • b2b2c电商平台网站seo专业培训技术
  • 在国税网站更换购票员怎么做企业宣传推广
  • 什么是建站怎么做网页
  • b2c商城网站建设价格百度风云榜各年度小说排行榜
  • 可以做app的网站有哪些惠州关键词排名提升
  • wordpress使用什么数据库连接宁波关键词优化品牌
  • 有什么做图片赚钱的网站长沙seo优化推广公司
  • 手机网站用单独做吗宁波seo软件免费课程
  • 网站开发英语英语广州seo网站开发
  • 个人网站页面设计素材百度广告运营
  • 做网站游戏需要什么优化大师是什么
  • 优秀的响应式网站专门做排行榜的软件
  • 云商城的网站建设做市场推广应该掌握什么技巧
  • wordpress仿头条优化网站链接的方法
  • 软件测试网站开发与测试免费注册网址
  • 垂直网站怎么做优化方案模板