JavaScript/array/find:修订间差异
来自康健生活
小 文字替换 -“{{leftrightflex|”替换为“{{Double-columns|” |
|||
| 第2行: | 第2行: | ||
== other == | == other == | ||
find 方法会更改引用 | find 方法会更改引用 | ||
{{ | {{Double-columns|<syntaxhighlight lang="javascript">const source = [1,2,3]; | ||
const target = source.find(_ => _ === 1); | const target = source.find(_ => _ === 1); | ||
source[0] = 4; | source[0] = 4; | ||