Toolverse
All skills

js-early-exit

by TheOrcDev

Use early returns to avoid unnecessary computation in loops and functions. Apply when processing arrays, validating input, or checking multiple conditions where the result can be determined before all iterations complete.

Installation

Pick a client and clone the repository into its skills directory.

Installation

Quick info

Author
TheOrcDev
Category
Frontend
Views
3

About this skill

Use early returns to avoid unnecessary computation in loops and functions. Apply when processing arrays, validating input, or checking multiple conditions where the result can be determined before all iterations complete.

How to use

  1. Zainstaluj skill w swoim projekcie Claude, dodając plik js-early-exit do katalogu .claude/skills.

  2. Identyfikuj funkcje, które iterują przez tablice lub sprawdzają wiele warunków bez przerywania pętli — szczególnie tam, gdzie wynik można ustalić przed końcem iteracji.

  3. Refaktoryzuj funkcję, aby zwracała wynik natychmiast zamiast kontynuować pętlę — na przykład w walidacji danych zwróć błąd przy pierwszym nieprawidłowym polu, zamiast sprawdzać wszystkie pola.

  4. Zastosuj early return w funkcjach wyszukujących — gdy znajdziesz szukany element, zwróć go od razu zamiast kontynuować przeszukiwanie.

  5. Przetestuj refaktoryzowany kod, aby upewnić się, że zwraca poprawne wyniki i rzeczywiście pomija niepotrzebne obliczenia.

  6. Powtórz proces dla innych funkcji w kodzie, gdzie iteracja lub warunki mogą być przerwane wcześnie bez utraty poprawności.

Related skills

frontend-slides

by sickn33

Create stunning, animation-rich HTML presentations from scratch or by converting PowerPoint files. Use when the user wants to build a presentation, convert a PPT/PPTX to web, or create slides for a talk/pitch. Helps non-designers discover their aesthetic through visual

Frontend
65135

react

by lobehub

React component development guide. Use when working with React components (.tsx files), creating UI, using @lobehub/ui components, implementing routing, or building frontend features. Triggers on React component creation, modification, layout implementation, or navigation tasks.

Frontend
2058

senior-fullstack

by davila7

Comprehensive fullstack development skill for building complete web applications with React, Next.js, Node.js, GraphQL, and PostgreSQL. Includes project scaffolding, code quality analysis, architecture patterns, and complete tech stack guidance. Use when building new projects,

Frontend
2896

keyword-research

by openclaw

Discovers high-value keywords with search intent analysis, difficulty assessment, and content opportunity mapping. Essential for starting any SEO or GEO content strategy.

Frontend
24138

screenshot-to-code

by OneWave-AI

Convert UI screenshots into working HTML/CSS/React/Vue code. Detects design patterns, components, and generates responsive layouts. Use this when users provide screenshots of websites, apps, or UI designs and want code implementation.

Frontend
94209

apple-reminders

by openclaw

Manage Apple Reminders via the `remindctl` CLI on macOS (list, add, edit, complete, delete). Supports lists, date filters, and JSON/plain output.

Frontend
2085