We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
/** * 从数组的末尾开始搜索数组 * * @since 2023 * @see * @example */ const array = [{ v: 2023 }, { v: 2022 }] console.log(array.findLast((ele) => ele.v === 2022)) // { v: 2023 } console.log(array.findLastIndex((ele) => ele.v > 2023)) // -1 /** * 非破坏性的 反转旧数组 * * @since 2023 * @see * @example * * // */ const oldArray = ['1', '2', '3'] const newArray = oldArray.toReversed() console.log('oldArray', oldArray) console.log('newArray', newArray) /** * 非破坏性的 排序数组 * * @since 2023 * @see * @example * */ const oldArray1 = ['3', '2', '1'] const newArray1 = oldArray1.toSorted() console.log('oldArray', oldArray1) // ['3', '2', '1'] console.log('newArray', newArray1) // ['1', '2', '3'] /** * 非破坏性的 * * @since 2023 * @see * @example * */ const oldArray2 = ['1', '2', '3'] const newArray2 = oldArray1.toSpliced(1, 2, 'x') console.log(oldArray2) console.log(newArray2) /** * with * * @since 2023 * @see * @example * */ const oldArray3 = ['1', '2', '3'] const newArray3 = oldArray3.with(1, 'X') console.log(oldArray3) // ['1', '2', '3'] console.log(newArray3) // ['1', 'X', '3'] /** * weakmap * * @since 2023 * @see * @example * */ const wm = new WeakMap() // Symbol 的 key const key = Symbol('sym-key') const object = {} wm.set(key, object)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The text was updated successfully, but these errors were encountered: