SShortSingh.
Back to feed

ES2023 findLast() replaces inefficient reverse-then-find array workaround

0
·1 views

JavaScript's ES2023 introduced findLast() and findLastIndex() as native array methods that search from the end of an array without copying or reversing it. Previously, developers used a spread-and-reverse workaround to locate the last matching element, which was memory-inefficient and harder to read. findLast() accepts the same predicate callback as find() but traverses the array backward in a single pass, returning the matching element or undefined if none is found. findLastIndex() complements it by returning the index of the last match, or -1 on failure, useful for slicing or splicing operations. Both methods have been supported across major browsers since 2022 and are fully typed in TypeScript 4.9 and later.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

Developer builds free Chrome extension to auto-generate bug reports for AI coding tools

A full-stack developer has released Repliqa, a free Chrome extension designed to streamline bug reporting when using AI coding assistants like Claude Code and Cursor. The tool automatically captures screenshots, console errors, network requests, and reproduction steps, then formats them into a ready-to-paste report. The developer was motivated by repeated frustration with manually gathering diagnostic information just to give AI tools enough context to fix a problem. Repliqa runs entirely on-device with no backend or account required, and sensitive fields are redacted before inclusion in any report. Released without paid promotion, the extension has accumulated around 30 installs within two weeks of launch.

0
ProgrammingDEV Community ·

Compact Design lets AI models write JSON that Figma imports as native frames

A developer has released Compact Design, an open-source JSON format designed to bridge AI language models and Figma by providing a structured, schema-validated input layer. The format allows models to describe UI layouts in plain JSON, which a core TypeScript library then validates, normalizes, lints, and patches before a Figma plugin renders them as native, editable frames. The core library operates independently of Figma's plugin API, returning structured error and lint feedback that makes it easier for models to self-correct invalid output. Patch operations support granular node-level updates, with automatic rollback on failure to preserve the previous design state. The project is available on GitHub under the MPL-2.0 license, though the npm package has not yet been published.

0
ProgrammingDEV Community ·

Shadow AI, Not Hallucinations, Is the Real LLMOps Risk, Says CNCF

As large language models enter production environments, a new operational discipline called LLMOps is emerging on top of existing DevOps and MLOps workflows, often without a clear owner. CNCF's Daniel Bryant argues that LLMOps should not become a separate stack but instead be treated as a standard capability within an organisation's existing platform engineering framework. The greatest risk, according to the analysis, is teams independently building RAG pipelines and vector stores outside any platform governance — a phenomenon dubbed 'shadow AI'. Tools already available in the CNCF ecosystem, including Backstage, Crossplane, and KubeVela, can expose LLM infrastructure through the same governed, self-service interfaces used for other platform resources. The CNCF TAG App Delivery Platforms Working Group is actively developing guidance for organisations working through LLMOps ownership and governance.

0
ProgrammingDEV Community ·

One Git repo can sync AI coding standards across Cursor, Claude Code, and Copilot

A developer has released v0.2 of an open-source 'agent-standards-kit' that lets teams maintain a single set of AI coding standards and automatically distribute them across multiple AI coding tools, including Cursor, Claude Code, GitHub Copilot, and Codex. The kit uses a shared SKILL.md format and a central AGENTS.md file as a tool-agnostic base, with each tool's adapter reading from its expected location and format. Cross-platform compatibility is handled by using directory junctions on Windows and symlinks on macOS and Linux, so the setup scripts work without administrator privileges. The sync scripts also detect which tools are actually installed, avoiding empty directories for unused tools. A follow-up post is planned covering how to keep standards current through a nudge-to-skill-to-PR workflow.