42 个通过示例解释所有 JavaScript 数组方法

今天,就让我们一起来看看这 42 个数组方法。

1. at

获取特定索引处的元素。

负索引表示从末尾开始计数(例如:-1 是最后一个元素)。

const names = ["Jhon", "Bob", "Alice", "Joe"];
const nameAtIndex1 = names.at(1);const nameAtLastIndex = names.at(-1);const nameAtBeforeLastIndex = names.at(-2);const nameAtNonExistingIndex = names.at(10);console.log(nameAtIndex1); // Output : Bobconsole.log(nameAtLastIndex); // Output : Joeconsole.log(nameAtBeforeLastIndex); // Output : Aliceconsole.log(nameAtNonExistingIndex); // Output : undefined

2.concat

将给定的数组元素添加到调用者数组的末尾。

const manNames = ["Jhon", "Bob"];const womanNames = ["Alice"];
const nameConcatenation = manNames.concat(womanNames);console.log(nameConcatenation); // Output : ["Jhon", "Bob", "Alice"]

3. copyWithin

将给定开始索引和结束索引之间的元素复制到目标索引。

负索引表示从最后一个开始计数(例如:-1 是最后一个元素)。

let letters = [];
// Copy to index 1, all elements form the index 3 to index 5 not included ("d" and "e")letters = ["a", "b", "c", "d", "e", "f", "g", "h"];letters.copyWithin(1, 3, 5);console.log(letters);// Output : ["a", "d", "e", "d", "e", "f", "g", "h"]
// Copy to index 1, all elements form the index 3 to end ("d", "e", "f", "g" and "h")letters = ["a", "b", "c", "d", "e", "f", "g", "h"];letters.copyWithin(1, 3);console.log(letters);// Output : ["a", "d", "e", "f", "g", "h", "g", "h"]
// Copy to index -7 (equivalent to 2), all elements from the index -6 (equivalent to 3) to index 5 not included ("d" and "e")letters = ["a", "b", "c", "d", "e", "f", "g", "h"];letters.copyWithin(-7, -6, 5);console.log(letters);// Output : ["a", "d", "e", "d", "e", "f", "g", "h"]

4.  entries

返回一个迭代器,其中,包含每个数组元素的索引/值对的数组。

const letters = ["a", "b"];
const iterator1 = letters.entries();console.log(iterator1.next().value); // Output [0, 'a']console.log(iterator1.next().value); // Output : [0, 'b']console.log(iterator1.next().value); // Output : undefined

5. every

检查所有数组元素是否验证给定条件并返回 true。否则,返回 false。

const numbers = [10, 15, 20, 25, 30];
const isAllNumbersBelow40 = numbers.every((number) => number < 40);console.log(isAllNumbersBelow40); // Output : true
const isAllNumbersBelow20 = numbers.every((number) => number < 20);console.log(isAllNumbersBelow20); // Output : false

6. fill

按给定值从开始索引到结束索引填充数组。

负索引表示从最后一个开始计数(例如:-1 是最后一个元素)。

let numbers = [];
/** Fill 0 on numbers start at index 1 to index 4 not included (3 elements) */numbers = [1, 1, 1, 1, 1];numbers.fill(0, 1, 4);console.log(numbers);// Output : [1, 0, 0, 0, ]
/** Fill 0 on numbers start at index 1 to the end (4 elements) */numbers = [1, 1, 1, 1, 1];numbers.fill(0, 1);console.log(numbers);// Output : [1, 0, 0, 0, 0]
/** Fill 0 on all numbers */numbers = [1, 1, 1, 1, 1];numbers.fill(0);console.log(numbers);// Output : [0, 0, 0, 0, 0]
/** Fill 0 on numbers start at index -4 (equivalent to 2) to index -1 (equivalent to 4) not included (3 elements) */numbers = [1, 1, 1, 1, 1];numbers.fill(0, -4, -1);console.log(numbers);// Output : [1, 0, 0, 0, 1]

7.filter

返回仅包含验证条件的元素的新数组。

const names = ["Joe", "Jhon", "Alice"];
const namesWith4LettersOrLess = names.filter((name) => name.length <= 4);console.log(namesWith4LettersOrLess); // Output : ["Joe", "Jhon"]

8. find

找到第一个验证条件的元素并返回它。否则,返回未定义。

const names = ["Joe", "Jhon", "Alice"];
const firstNameMatchStartWithJ = names.find((name) => name.startsWith("J"));console.log(firstNameMatchStartWithJ); // Output : Joe
const firstNameMatchStartWithK = names.find((name) => name.startsWith("K"));console.log(firstNameMatchStartWithK); // Output : undefined

9. findIndex

找到第一个验证条件的元素并返回其索引。否则,返回-1。

const names = ["Joe", "Jhon", "Alice"];
const firstNameMatchStartWithJ = names.findIndex((name) => name.startsWith("J"));console.log(firstNameMatchStartWithJ); // Output : 0
const firstNameMatchStartWithK = names.findIndex((name) => name.startsWith("K"));console.log(firstNameMatchStartWithK); // Output : -1

10.findLast

找到验证条件的最后一个元素并将其返回。否则,返回未定义。

const names = ["Joe", "Jhon", "Alice"];
const lastNameMatchStartWithJ = names.findLast((name) => name.startsWith("J"));console.log(lastNameMatchStartWithJ); // Output : Jhon
const lastNameMatchStartWithK = names.findLast((name) => name.startsWith("K"));console.log(lastNameMatchStartWithK); // Output : undefined

11.  findLastIndex

找到最后一个验证条件的元素并返回其索引。否则,返回-1。

const names = ["Joe", "Jhon", "Alice"];
const lastNameMatchStartWithJ = names.findLastIndex((name) => name.startsWith("J"));console.log(lastNameMatchStartWithJ); // Output : 1
const lastNameMatchStartWithK = names.findLastIndex((name) => name.startsWith("K"));console.log(lastNameMatchStartWithK); // Output : -1

12. flat

在每个元素中展开任何已建立的数组,并根据给定的深度级别继续展开嵌套的数组。返回新的平面数组。

const numbers = [1, 2, [3, [4, [5, 6]]]];
const flatNumbersLevel1 = numbers.flat();console.log(flatNumbersLevel1); // Output : [1, 2, 3, [4, [5, 6]]]
const flatNumbersLevel2 = numbers.flat(2);console.log(flatNumbersLevel2); // Output : [1, 2, 3, 4, [5, 6]]
const flatNumbers = numbers.flat(Infinity);console.log(flatNumbers); // Output : [1, 2, 3, 4, 5, 6]

13. flatMap

返回一个新数组,其中所有元素均由给定回调修改,并按 1 深度级别展平。

const users = [  {    name: "Jhon",    votes: [3, 4]  },  {    name: "Joe",    votes: [4, 5]  }];
const allVotes = users.flatMap((user) => user.votes);console.log(allVotes); // Output : [3, 4, 4, 5]

14. forEach

迭代数组并对每个元素应用给定的回调。

const names = ["Joe", "Jhon", "Alice"];
names.forEach((name, index, array) =>  console.log(`${name} at index ${index} in the array [${array.join(", ")}]`));// Output : Joe at index 0 in the array [Joe, Jhon, Alice]// Output : Jhon at index 1 in the array [Joe, Jhon, Alice]// Output : Alice at index 2 in the array [Joe, Jhon, Alice]

15.  from

从可迭代或类似数组创建数组。

/** Create an array from string */console.log(Array.from("hello"));// Output : ["h", "e", "l", "l", "o"]
/** Create an array from an other array and apply map method */console.log(Array.from([1, 2, 3], (x) => x * 2));// Output : [2, 4, 6]

16. fromAsync

从异步可迭代、可迭代或类数组创建数组。

/** Create an array from an array of async elements */const asyncArray = [  new Promise((resolve) => resolve(0)),  new Promise((resolve) => resolve(1))];
(async () => {  const array = await Array.fromAsync(asyncArray);  console.log(array); // Output : [0, 1]})();

17.  includes

检查数组是否包含给定元素。

const letters = ["a", "b", "c"];
console.log(letters.includes("b")); // Output: trueconsole.log(letters.includes("e")); // Output: false

18.  indexOf

返回给定元素的第一个匹配项的索引。如果找到任何匹配项,则返回 -1。

const letters = ["a", "b", "c", "d"];
/** Get index of existing letter 'b' */console.log(letters.indexOf("b")); // Output: 1
/** Get index of existing letter 'b' but start searching from index 2 */console.log(letters.indexOf("b", 2)); // Output: -1
/** Get index of existing letter 'b' but start searching from index -4 (equivalent to 0) */console.log(letters.indexOf("b", -4)); // Output: 1
/** Get index of non existing letter 'e' */console.log(letters.indexOf("e")); // Output: -1

19. isArray

检查变量是否是数组。

const array = [];console.log(Array.isArray(array)); // Output : true
const object = {};console.log(Array.isArray(object)); // Output : false

20. join

将所有数组元素连接到一个字符串,并用给定的分隔符将它们分开。

const letters = ["h", "e", "l", "l", "o"];
/** Join all letters together with default separator comma */console.log(letters.join());// Output : h,e,l,l,o
/** Join all letters together with no separator */console.log(letters.join(""));// Output : hello
/** Join all letters together with dash separator */console.log(letters.join("-"));// Output : h-e-l-l-o

21.  keys

返回包含索引的迭代器。

const letters = ["a", "b"];
const iterator1 = letters.keys();console.log(iterator1.next().value); // Output 0console.log(iterator1.next().value); // Output : 1console.log(iterator1.next().value); // Output : undefined

22.lastIndexOf

返回给定元素的最后一个匹配项的索引。如果找到任何匹配项,则返回 -1。

const letters = ["a", "b", "b", "a"];
/** Get last index of existing letter 'b' */console.log(letters.lastIndexOf("b")); // Output: 2
/** Get index of non existing letter 'e' */console.log(letters.lastIndexOf("e")); // Output: -1

23. map

返回一个新数组,其中所有元素均由给定回调修改。

const numbers = [1, 2, 3];
/** Double all numbers */const doubleNumebrs = numbers.map((number) => number * 2);console.log(doubleNumebrs);// Output : [2, 3, 6]
/** Get number array info */const numberArrayInfo = numbers.map(  (element, index, array) =>    `${element} at index ${index} in the array [${array.join(", ")}]`);console.log(numberArrayInfo);// Output : ["1 at index 0 in the array [1, 2, 3]", "2 at index 1 in the array [1, 2, 3]", "3 at index 2 in the array [1, 2, 3]"]

24. of

从给定的元素创建一个数组。

/** Create an array from values */const numbers = Array.of(1, 2, 3, 4);console.log(numbers);// Output: [1, 2, 3, 4]

25.pop

删除数组的最后一个元素并返回它。

/** Create an array from values */const numbers = [1, 2, 3, 4];console.log(numbers.pop()); // Output : 4console.log(numbers); // Output : [1, 2, 3]

26. push

将新元素添加到数组中。

/** add value or values to the end of array */const numbers = [1, 2, 3, 4];numbers.push(5);numbers.push(6, 7);console.log(numbers);// Output : [1, 2, 3, 4, 5, 6, 7]/** Create an array from values */

27. reduce

通过应用给定的回调将数组减少到一个值。给定的回调应在每次迭代中返回更新的值。

/** Reduce hello array to hello string */const letters = ["h", "e", "l", "l", "o"];const word = letters.reduce((accWord, letter) => `${accWord}${letter}`);console.log(word);// Output : hello

28. reduceRight

它类似于reduce方法,但从数组的最后一个元素开始迭代。

/** Reduce hello array to olleh string */const letters = ["h", "e", "l", "l", "o"];const word = letters.reduceRight((accWord, letter) => `${accWord}${letter}`);console.log(word);// Output : olleh

29. reverse

反转数组元素的顺序。

/** Reverse hello array to olleh array */const letters = ["h", "e", "l", "l", "o"];letters.reverse();console.log(letters);// Output : ["o", "l", "l", "e", "h"]

30.shift

删除数组的第一个元素并返回它。

/** Reverse number order of number array */const numbers = [1, 2, 3];numbers.reverse();console.log(numbers);// Output : [3, 2, 1];

31.slice

返回从给定开始到结束索引的子数组。

负索引表示从最后一个开始计数(例如:-1 是最后一个元素)。

const numbers = ["a", "b", "c", "d", "e"];
/** Get numbers from index 1 to index 4 not included ("b", "c" and "d") */console.log(numbers.slice(1, 4));// Output : ["b", "c", "d"]
/** Get numbers from index 1 to the end ("b", "c", "d" and "e") */console.log(numbers.slice(1));// Output : ["b", "c", "d", "e"]
/** Get numbers from index -4 (equivalent to 1) to index -1 (equivalent to 4) not included ("b", "c" and "d") */console.log(numbers.slice(-4, -1));// Output : ["b", "c", "d"]

32. some

检查是否至少有一个元素验证给定条件。

const numbers = [10, 15, 20, 25, 30];
const isAtLeastOneBelow20 = numbers.some((number) => number < 20);console.log(isAtLeastOneBelow20); // Output : true
const isAtLeastOneBelow5 = numbers.some((number) => number < 5);console.log(isAtLeastOneBelow5); // Output : false

33.  sort

通过给定的回调返回排序的数组。

如果回调返回正数,则将 a 排序在 b 之后。否则,将 b 排序在 a 之后。

let numbers = [];
/** Sort number in ascendent order. Sort a after b. */numbers = [10, 100, 20, 25, 30];numbers.sort((a, b) => a - b);console.log(numbers); // Output : [10, 20, 25, 30, 100]
/** Sort number in descendant order. Sort b after a */numbers = [10, 100, 20, 25, 30];numbers.sort((a, b) => b - a);console.log(numbers); // Output : [100, 30, 25, 20, 10]

34. splice

删除或替换从给定开始索引到给定结束索引的子数组。

负索引表示从最后一个开始计数(例如:-1 是最后一个元素)。

let numbers = [];
/** Remove elements from index 1 to 3 elements further ([0, 0, 0]) */numbers = [1, 0, 0, 0, 1];numbers.splice(1, 3);console.log(numbers);// Output : [1, 1]
/** Remove elements from index 1 to the end ([0, 0, 0, 1]) */numbers = [1, 0, 0, 0, 1];numbers.splice(1);console.log(numbers);// Output : [1]
/** Remove elements from index -4 (equivalent to 1) to the end ([0, 0, 0, 1]) */numbers = [1, 0, 0, 0, 1];numbers.splice(-4);console.log(numbers);// Output : [1]
/** Replace elements by 2, 2, 2 from index 1 to index 3 included ([0, 0, 0]) */numbers = [1, 0, 0, 0, 1];numbers.splice(1, 3, 2, 2, 2);console.log(numbers);// Output : [1, 2, 2, 2, 1]
/** Replace elements by 2, 2, 2 from index -4 (equivalent to 1) to 3 elements further ([0, 0, 0]) */numbers = [1, 0, 0, 0, 1];numbers.splice(-4, 3, 2, 2, 2);console.log(numbers);// Output : [1, 2, 2, 2, 1]
/** Add elements 2, 2, 2 at index 1 */numbers = [1, 0, 0, 0, 1];numbers.splice(1, 0, 2, 2, 2);console.log(numbers);// Output : [1, 2, 2, 2, 0, 0, 0, 1]

35. toLocaleString

将所有元素转换为语言环境字符串,将所有元素连接为字符串,同时用逗号分隔每个元素并返回字符串。

const date = [10.4, new Date("31 Aug 2022 22:00:00 UTC")];
console.log(date.toLocaleString());// Output : 10.4,9/1/2022, 12:00:00 AM
console.log(date.toLocaleString("en"));// Output : 10.4,9/1/2022, 12:00:00 AM
console.log(date.toLocaleString("es"));// Output : 10,4,1/9/2022, 0:00:00

36. toReversed

创建一个新数组,其中,按相反顺序包含调用方数组的元素。

它类似于“reverse”方法,但它返回一个新数组而不修改调用者数组。

const numbers = [1, 2, 3];
const reversedNumbers = numbers.toReversed();
console.log(reversedNumbers); // Output : [3, 2, 1]console.log(numbers); // Output : [1, 2, 3]

37. toSorted

创建一个新数组,其中包含按给定回调排序的调用者数组的元素。

它类似于“sort”方法,但它返回一个新数组而不修改调用者数组。

const numbers = [10, 100, 20, 25, 30];
/** Sort number in ascendent order. Sort a after b. */const numbersInAscOrder = numbers.toSorted((a, b) => a - b);console.log(numbersInAscOrder); // Output : [10, 20, 25, 30, 100]console.log(numbers); // Output : [10, 100, 20, 25, 30]
/** Sort number in descendant order. Sort b after a */const numbersInDescOrder = numbers.toSorted((a, b) => b - a);console.log(numbersInDescOrder); // Output : [100, 30, 25, 20, 10]console.log(numbers); // Output : [10, 100, 20, 25, 30]

38. toSpliced

创建一个新数组,其中包含调用方数组的元素以及已替换或删除的元素。

它类似于“splice”方法,但它返回一个新数组而不修改调用者数组。

负索引表示从最后一个开始计数(例如:-1 是最后一个元素)。

let numbers = [1, 0, 0, 0, 1];
/** Remove elements from index 1 to 3 elements further ([0, 0, 0]) */const splicedNumbers1 = numbers.toSpliced(1, 3);console.log(splicedNumbers1); // Output : [1, 1]console.log(numbers); // Output : [1, 0, 0, 0, 1]
/** Replace elements by 2, 2, 2 from index 1 to index 3 included ([0, 0, 0]) */const splicedNumbers2 = numbers.toSpliced(1, 3, 2, 2, 2);console.log(splicedNumbers2); // Output : [1, 2, 2, 2, 1]console.log(numbers); // Output : [1, 0, 0, 0, 1]
/** Add elements 2, 2, 2 at index 1 */const splicedNumbers3 = numbers.toSpliced(1, 0, 2, 2, 2);console.log(splicedNumbers3); // Output : [1, 2, 2, 2, 0, 0, 0, 1]console.log(numbers); // Output : [1, 0, 0, 0, 1]

39.  toString

通过将所有元素连接到字符串,同时用逗号分隔每个元素并返回字符串,将所有元素转换为区域设置字符串。

const letters = ["a", "b", "c", "d"];
/** Join all letters together with default separator comma */console.log(letters.toString());// Ouput : a,b,c,d

40. unshift

将元素添加到数组中第一个元素之前。

const numbers = [3, 4];
numbers.unshift(0, 1, 2);console.log(numbers); // Output : [0, 1, 2, 3, 4]

41.  values

返回一个迭代器,该迭代器迭代数组中每个项目的值。

const letters = ["a", "b"];
const letterIterator = letters.values();console.log(letterIterator.next().value); // Output : aconsole.log(letterIterator.next().value); // Output : bconsole.log(letterIterator.next().value); // Output : undefined

42.  with

创建一个新数组,其中包含调用方数组的元素以及给定索引处替换的给定值。

负索引表示从最后一个开始计数(例如:-1 是最后一个元素)。

const letters = ["a", "k", "c", "d"];
/** replace k at index 1 with b */console.log(letters.with(1, "b"));// Output : ["a", "b", "c", "d"]
/** replace k at index -3 (equivalent to 1) with b */console.log(letters.with(-3, "b"));// Output : ["a", "b", "c", "d"]

结论

以上就是42个数组的全部方法

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/590216.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

服装店收银系统不只是收银 还需要线上商城和线上批发

一个综合性的服装店收银系统可以结合线上商城和线上批发功能&#xff0c;提供以下特点和优势&#xff1a; 线上商城&#xff1a;将服装店的商品信息同步到线上商城平台&#xff0c;让顾客可以通过网站或移动应用程序浏览和购买商品。线上商城可以实现在线支付、订单跟踪、售后服…

MySQL数据库索引优化

一、引言 1. 索引的重要性 MySQL数据库索引的重要性主要体现在&#xff0c;一是查询速度优化&#xff0c;索引可以极大地提高查询速度。对于没有索引的表&#xff0c;MySQL必须进行全部扫描来找到所需的行&#xff0c;如果表中数据量很大&#xff0c;那么通常很慢。通过适当的…

大数据规模存储的几个核心问题

文章目录 三个关键问题RAID&#xff08;独立磁盘冗余阵列&#xff09;RAID是如何解决关于存储的三个关键问题&#xff1f;水平伸缩 大规模数据存储都需要解决几个核心问题&#xff0c;这些问题都是什么呢&#xff1f; 三个关键问题 1.数据存储容量的问题 既然大数据要解决的…

图像分割实战-系列教程1:语义分割与实例分割概述

&#x1f341;&#x1f341;&#x1f341;图像分割实战-系列教程 总目录 有任何问题欢迎在下面留言 本篇文章的代码运行界面均在Pycharm中进行 本篇文章配套的代码资源已经上传 下篇内容&#xff1a; Unet系列算法 1、图像分割任务概述 1.1 图像分割 分割任务就是在原始图像…

window的OPen方法,弹窗的特征

文章目录 一、介绍二、弹窗的特征 一、介绍 window.open() 方法是 JavaScript 中的一个内置方法&#xff0c;用于在浏览器中打开一个新的窗口或标签页。 语法&#xff1a; window.open(url, name, features, replace)二、弹窗的特征 open方法参数说明: 参数说明url要载入窗…

【算法】数论---取模运算法则

取模运算&#xff08;余数运算&#xff09;有一些基本的运算法则&#xff1a; (a b) % m (a % m b % m) % m(a - b) % m (a % m - b % m) % m(a * b) % m (a % m * b % m) % ma ^ b % p ((a % p)^b) % p 取模运算&#xff08;余数运算&#xff09;有一些基本的性质&…

2023年12月第4周面试算法题总结

809. 情感丰富的文字——阅读理解题 1、s “abcd”; words [“abc”]; 的情况怎么处理 2、怎么求lens与lenw&#xff1f;&#xff08;连续出现的字符串长度&#xff09; class Solution { public: bool isStretchy(const string& s, const string& word) {int i 0…

基于SpringBoot的医疗挂号管理系统

文章目录 项目介绍主要功能截图:部分代码展示设计总结项目获取方式🍅 作者主页:超级无敌暴龙战士塔塔开 🍅 简介:Java领域优质创作者🏆、 简历模板、学习资料、面试题库【关注我,都给你】 🍅文末获取源码联系🍅 项目介绍 基于SpringBoot的医疗挂号管理系统,java…

详述numpy中的np.random各个函数的用法

文章目录 引言np.random.rand()np.random.randn()np.random.randint(low&#xff0c;high&#xff0c;size&#xff0c;dtype)np.random.uniform(low&#xff0c;high&#xff0c;size)参考文献 引言 在机器学习还有深度学习中&#xff0c;经常会用到这几个函数&#xff0c;为…

AKShare学习笔记

AKShare学习笔记 本文内容参考AKShare文档。AKShare开源财经数据接口库采集的数据都来自公开的数据源&#xff0c;数据接口查询出来的数据具有滞后性。接口参考AKShare数据字典。 AKShare环境配置 安装Anaconda&#xff0c;使用Anaconda3-2019.07版本包&#xff0c;配置清华数…

Elasticsearch8集群部署

转载说明&#xff1a;如果您喜欢这篇文章并打算转载它&#xff0c;请私信作者取得授权。感谢您喜爱本文&#xff0c;请文明转载&#xff0c;谢谢。 本文记录在3台服务器上离线搭建es8.7.1版本集群。 1. 修改系统配置 1.1 hosts配置 在三台es节点服务器加入hostname解析&…

加法器原理详解

加法器的介绍与原理分析 什么是加法器&#xff1f; 加法器是一种数字电路&#xff0c;用于将两个二进制数相加并输出它们的和。 如何实现加法器 要讨论如何实现加法器就要先从只有一位的数字先进行考虑 一位二进制数相加 不考虑来自低位的进位——半加器 对于一位二进制…

【VTK三维重建-体绘制】第四期 VTK中GPU加速

很高兴在雪易的CSDN遇见你 VTK技术爱好者 QQ&#xff1a;870202403 前言 上期内容讲到VTK的体绘制技术vtkGPUVolumeRayCastMapper&#xff0c;本文分享VTK中GPU加速的相关内容&#xff0c;希望对各位小伙伴有所帮助&#xff01; 感谢各位小伙伴的点赞关注&#xff0c;小易会…

图像分割实战-系列教程7:unet医学细胞分割实战5(医学数据集、图像分割、语义分割、unet网络、代码逐行解读)

&#x1f341;&#x1f341;&#x1f341;图像分割实战-系列教程 总目录 有任何问题欢迎在下面留言 本篇文章的代码运行界面均在Pycharm中进行 本篇文章配套的代码资源已经上传 unet医学细胞分割实战1 unet医学细胞分割实战2 unet医学细胞分割实战3 unet医学细胞分割实战4 unet…

机器学习的分类与经典算法

机器学习算法按照学习方式分类&#xff0c;可以分为有监督学习&#xff08;Supervised Learning&#xff09;、无监督学习&#xff08;Unsupervised Learning&#xff09;、半监督学习&#xff08;Semi-supervised Learning&#xff09;、强化学习&#xff08;Reinforcement Le…

[NAND Flash 5.1] 闪存芯片物理结构与SLC/MLC/TLC/QLC

依公知及经验整理,原创保护,禁止转载。 专栏 《深入理解NAND Flash》 <<<< 返回总目录 <<<< 前言 1 闪存芯片简介 闪存颗粒是固态硬盘中数据的真实存储地,就像机械硬盘的磁盘一样。 闪存颗粒flash memory是一种存储介质,重要的区别于传统机械盘…

bat脚本:将ini文件两行值转json格式

原文件 .ini&#xff1a;目标转换第2行和第三行成下方json [info] listKeykey1^key2^key3 listNameA大^B最小^c最好 ccc1^2^3^ ddd0^1^9目标格式 生成同名json文件&#xff0c;并删除原ini文件 [ { "value":"key1", "text":"A大" …

动态规划 | 最长公共子序列问题

文章目录 最长公共子序列题目描述问题分析程序代码复杂度分析 最短编辑距离题目描述问题分析程序代码复杂度分析 编辑距离题目描述输入格式输出格式 问题分析程序代码 最长公共子序列 题目描述 原题链接 给定两个字符串 text1 和 text2&#xff0c;返回这两个字符串的最长 公共…

图文证明 等价无穷小替换

等价无穷小替换 定义 等价无穷小是无穷小之间的一种关系&#xff0c;指的是&#xff1a;在同一自变量的趋向过程中&#xff0c;若两个无穷小之比的极限为1&#xff0c;则称这两个无穷小是等价的。无穷小等价关系刻画的是两个无穷小趋向于零的速度是相等的。 设当 x → x 0 时…

Android 接入第三方数数科技平台

提示&#xff1a;文章写完后&#xff0c;目录可以自动生成&#xff0c;如何生成可参考右边的帮助文档 文章目录 前言一、数数科技平台是什么&#xff1f;二、使用步骤1.集成SDK2. 初始化3. 发送事件和设置账号id4. 验证发送事件是否成功 小结 前言 一个成熟的App必然不可缺少对…