Elysia Tools

Browse tools, examples, visual explainers, and topic guides from one clear workspace.

Top Categories

Hubs

Language
ZHESPTRUFRDEEN

Elysia Tools

Navigation

Data Processing

Nth Item

· Last updated:2026-01-26

Get the item at a specific index using lodash _.nth

Details

What this tool helps you do

Return the item at a specific index in the array.

Highlights:

  • Uses lodash _.nth
  • Supports negative indices (counting from the end)
  • Returns a JSON-formatted value

Example:

  • Array: ["a", "b", "c", "d"]
  • Index: -1
  • Result: "d"

Execution

Run this tool

Fill in the form, run the tool, and review the result in one place.

Samples

Examples that match this tool

Related

Continue with connected tools and hubs

Written by the Elysia Tools team
Data Processing130
Array60
Lodash53

Tool usage guide

Learn when to use this tool, what it supports, and how real users apply it.

Key facts

Category
Data Processing
Input types
textarea, number
Output type
text
Sample coverage
4
API ready
Yes

Overview

The Nth Item tool retrieves the element at a specified index from a JSON array using the lodash _.nth function. It supports both positive and negative indices, allowing you to access items from the start or end of the array and returns the value in JSON format.

When to use

  • When you need to extract a specific element from an array by its position.
  • When working with arrays where negative indices are useful for counting from the end.
  • When you want a quick, reliable way to access array elements without writing custom code.

How it works

  1. 1Input a valid JSON array in the 'Array' field.
  2. 2Specify the index (zero-based, negative for reverse counting) in the 'Index' field.
  3. 3The tool uses lodash _.nth to fetch the item and outputs it as a JSON-formatted value.

Use cases

  • Extracting the last item from a list of logs or records for quick review.
  • Accessing a specific element in an array of configuration settings during automation.
  • Simplifying data extraction in scripts where array indices are dynamically determined.

Examples

1. Retrieve Last Transaction

Background

You have an array of recent transaction amounts and need the most recent one for a summary.

Problem

Manually counting indices to find the last element is error-prone and time-consuming.

How to use

Enter the transaction array, e.g., [50, 75, 100, 125], and set the index to -1.

Outcome

The tool returns 125, the last transaction amount, as a JSON value.

2. Get Third User Input

Background

Processing a list of user-submitted answers where the third answer is critical for analysis.

Problem

Need to consistently extract the third element without manual indexing each time.

How to use

Input the array of answers, e.g., ["yes", "no", "maybe", "unknown"], and set the index to 2.

Outcome

The third answer "maybe" is retrieved and displayed in JSON format.

FAQ

What does a negative index mean?

A negative index counts from the end of the array, where -1 is the last element.

What happens if the index is out of bounds?

The tool returns undefined for indices beyond the array length.

Can I use this with nested arrays or objects?

No, it works on a single-level array; for nested structures, use other data processing tools.

Is the index zero-based?

Yes, indices start at 0 for the first element, and negative indices count from the end.

What input format is required?

The array must be valid JSON, such as ["a", "b", "c"], and the index must be a number.

Home
Tools3201
Samples593
Visualizations465
Viewers103
Hubs233
Tags333
Images, Audio & Video657

Image, audio, and video processing, conversion, and optimization tools

Math, Date & Finance644

Calculators, numerics, date logic, statistics, and finance tools

Design & Color297

Color, layout, graphics, visual styling, and design helper tools

Text & Writing209

Writing, cleanup, formatting, extraction, and text analysis tools

Developer & Web193

Developer utilities, networking, web debugging, and automation helpers

Conversion & Encoding175

Format, file, archive, unit, and encoding conversion tools

FLAC/WAV Source Screening and Evidence Handoff
Self-Hosted Giveaway Widget Review and Embed Handoff
Stripe Promo Code Batch Review and Import Preflight
Batch Photo Culling Review and Editing Shortlist Handoff
UI Screenshot Structure Review and Development Handoff

© 2026 Elysia Tools. All rights reserved.

DocsPricingAboutTerms of ServicePrivacy PolicyCookiesContact
Monitoring

Grafana Advanced Application Samples

Comprehensive Grafana samples covering advanced dashboard design, alerting configurations, data source integrations, and plugin development

Media

QR Code Samples

Sample QR code images for testing QR code reading and generation tools

Data Visualization

D3.js Data Visualization Samples

Comprehensive D3.js data visualization examples including charts, maps, animations, and interactive visualizations

Developer Tools

Rome JavaScript Toolchain Samples

Rome JavaScript toolchain examples including configuration, linting, formatting, bundling, and project management

Data Processing

Get Path

Get a value at a path using lodash _.get

Data Processing

Group By

Group items by a derived key using lodash _.groupBy

Data Processing

Head Item

Get the first element of array using lodash _.head

Data Processing

Index Of

Find the index of a value in array using lodash _.indexOf