Elysia Tools

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

Top Categories

Hubs

Language
ZHDERUPTENFRES

Elysia Tools

Navigation

Data Processing

Fill Array

· Last updated:2026-01-21

Fill array with value from start to end index using lodash _.fill

Details

What this tool helps you do

Fill Array Tool

This tool uses lodash _.fill() method to populate array elements with a specified value.

Features:

  • Fill array elements with any value (string, number, boolean, object)
  • Specify start and end positions for partial filling
  • Parse values as JSON for proper type handling
  • Support for nested arrays and objects

Examples:

  1. Basic fill:
  • Input: [1, 2, 3, 4, 5]
  • Value: *
  • Start: 1, End: 4
  • Output: [1, '*', '*', '*', 5]
  1. Fill entire array:
  • Input: [null, null, null]
  • Value: "filled"
  • Start: 0, End: (leave empty)
  • Output: ["filled", "filled", "filled"]
  1. With JSON parsing:
  • Input: [1, 2, 3]
  • Value: true (with parseValueAsJSON checked)
  • Output: [true, true, true] (boolean, not string)

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
End17

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, text, number, checkbox
Output type
text
Sample coverage
4
API ready
Yes

Overview

The Fill Array tool uses lodash's _.fill() method to populate array elements with a specified value. It allows you to control the start and end indices for partial filling and supports JSON parsing to ensure values are handled with the correct data types.

When to use

  • When you need to replace multiple array elements with a constant value.
  • When you want to fill only a specific range within an array, leaving other elements unchanged.
  • When you require values to be parsed as JSON to maintain proper data types, such as booleans or objects.

How it works

  1. 1Input your array in the designated textarea.
  2. 2Specify the fill value and optionally set start and end indices.
  3. 3Enable 'Parse Value as JSON' if you need the value to be interpreted as a JSON type.
  4. 4The tool applies lodash _.fill() to generate the modified array.

Use cases

  • Initializing arrays with default values for testing or simulation.
  • Masking or anonymizing data by replacing sensitive elements with placeholders.
  • Preparing data structures by filling missing or placeholder values in specific positions.

Compare alternatives

  • Remove falsey values from array using lodash _.compact

  • Extract tables from PDFs with OpenDataLoader and export them as structured JSON, flat CSV, or HTML tables

  • Transform and process CSV data with column operations, calculations, and data type conversions.

Who it's for

Best for

  • Convert content in the browser.
  • Repeatable jobs with content and the same settings every time.
  • Jobs where the output is plain text.

Not ideal for

  • Fully automated batch jobs — this page is built for interactive use; use the API endpoint for scripts.
  • Content in other formats — this tool expects content.

Edge cases & common failures

  • Very large files

    Large files take longer and can hit browser memory limits — try a smaller sample first.

  • Skipping the output check

    Compare the first rows or pages of the output with the input before using it in production.

  • Files from unusual exporters

    Some files use format variants that do not convert cleanly — if the output looks wrong, re-save the file from the app that created it and try again.

Examples

1. Basic Partial Fill

Background

A developer has an array [1, 2, 3, 4, 5] and needs to replace elements from index 1 to 3 with '*'.

Problem

Manually editing the array is time-consuming and error-prone.

How to use

Input the array, set value to '*', start index to 1, end index to 4.

Outcome

The array becomes [1, '*', '*', '*', 5].

2. Fill Entire Array with String

Background

A user has an array of nulls [null, null, null] and wants to fill it with 'filled'.

Problem

Need to populate all elements with a consistent value.

How to use

Input the array, set value to 'filled', leave start and end indices as default or empty.

Outcome

The array is transformed to ['filled', 'filled', 'filled'].

3. JSON Parsed Boolean Fill

Background

An array [1, 2, 3] needs to be filled with boolean true values.

FAQ

What types of values can I use to fill the array?

You can use any value, including strings, numbers, booleans, or objects.

Can I fill only part of the array?

Yes, by specifying the start and end indices, you can fill a specific range.

Does the tool support nested arrays or objects?

Yes, it supports filling with nested structures, and JSON parsing ensures correct handling.

What happens if I don't specify an end index?

If left empty, the fill operation extends to the end of the array.

Is there a limit to the array size?

The tool can handle arrays of various sizes, but performance may depend on your browser's capabilities.

Home
Tools3212
Workbench
Samples593
Visualizations471
Viewers103
Hubs239
Tags333
Images, Audio & Video657

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

Math, Date & Finance647

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

Design & Color298

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

Lead Generation Quiz Launch and Contact Handoff
Memorial Drafts: Family Review and Print Handoff
Private Habit Records: Backup, Restore and Sharing Review
Article to X and LinkedIn Drafts: Fact Review and Handoff
Markdown Interactive Deck Review and Offline Handoff

© 2026 Elysia Tools. All rights reserved.

DocsPricingAboutTerms of ServicePrivacy PolicyCookiesContact
Observability

Distributed Tracing Samples

Comprehensive distributed tracing examples using Jaeger, OpenTelemetry, and other modern observability tools for microservices architecture

Cloud Services

AWS EventBridge Samples

AWS EventBridge examples including event buses, rules, targets, schema registry, custom events, and cross-account event routing for serverless event-driven architecture

Security

JWT Samples

Comprehensive JWT examples from basic token structure to advanced security implementations

Document

PDF Samples

Generated PDF samples from tools dated 2026-02-01 to 2026-02-10

Data Processing

Compact Array

Remove falsey values from array using lodash _.compact

Data Processing

Defaults Object

Apply default values to an object using lodash _.defaults

Data Processing

Drop Items

Drop first N items from array using lodash _.drop

Data Processing

Drop Right Items

Drop last N items from array using lodash _.dropRight

Problem

Without JSON parsing, 'true' would be a string, not a boolean.

How to use

Input the array, set value to 'true', enable 'Parse Value as JSON'.

parseValueAsJSON: true

Outcome

The array becomes [true, true, true] with boolean values.

Compact Array
PDF Table Extractor to CSV/JSON
CSV Transformer