Overview
Introduction
A palindrome-style list, one that reads the same forwards and backwards, is a fun visual effect and occasionally a genuinely useful structure for symmetric data or test fixtures.
List Mirror builds that structure automatically: your list, followed immediately by the same list reversed.
What Is List Mirror?
A tool that outputs list + reverse(list), doubling the item count and making the combined order read the same in both directions.
It's distinct from List Reverser, which replaces the order in place rather than appending, and from List Inverter, which reverses characters within items rather than item order.
How List Mirror Works
The input is split into items on the resolved separator, a reversed copy of that array is built with Array.prototype.reverse(), and the original items are concatenated with the reversed copy.
The combined, doubled-length list is then rejoined using the same separator and delimiter settings as the input.
When To Use List Mirror
Use it to build symmetric test data or fixtures where a palindrome-shaped sequence is genuinely useful.
It's also a quick way to create a decorative "echo" effect for a list in plain-text notes or presentations.
Often used alongside List Inverter, List Reverser and List Item Indenter.
Features
Advantages
- Guarantees a genuinely palindromic item order, verified by simple concatenation logic.
- Item content is never altered, characters within each item are untouched, only the overall order is mirrored.
- Works with any configured separator, not just newline-delimited lists.
Limitations
- The output is always twice the input length, which isn't appropriate if you actually wanted a true palindrome fold (middle item appearing once).
- Doesn't deduplicate the repeated middle item on odd-length lists; it appears exactly as the literal concatenation produces it.
Examples
Best Practices & Notes
Best Practices
- Use List Reverser instead if you just want the order reversed in place, without doubling the list.
- Use List Inverter instead if you want each item's characters reversed rather than the item order.
Developer Notes
Implemented as [...items, ...[...items].reverse()], a plain array spread and concatenation, so the original array reference is never mutated and both halves independently reflect the same source order.
List Mirror Use Cases
- Generating symmetric palindrome-shaped test fixtures or sample data
- Creating a decorative "echo" list effect for plain-text notes or presentations
- Demonstrating the difference between reversing order vs. reversing characters
Common Mistakes
- Expecting the middle item of an odd-length list to appear only once; it appears twice by design, once at the end of each half.
- Confusing this with List Reverser, which replaces rather than appends the reversed order.
- Confusing this with List Inverter, which reverses characters inside items rather than the order of items.
Tips
- Use List Reverser first if you actually want a reversed-then-mirrored combination for a more complex shape.
- Combine with List Skewer for a staircase-then-mirror visual effect.