Create JSON Array (ja)

A sophisticated yet simply way to build a JSON array

Description

Murex has a pretty sophisticated builtin for generating JSON arrays. It works a little bit like Bash’s {1..9} syntax but includes a few additional nifty features.

Please note that while this builtin is not marked for deprecation, it has been superseded by the %[] tokens. (read more)

Usage

ja [start..end] -> <stdout>
ja [start..end.base] -> <stdout>
ja [start..end,start..end] -> <stdout>
ja [start..end][start..end] -> <stdout>

Examples

» ja [1..5]
[
    "1",
    "2",
    "3",
    "4",
    "5"
]
» ja [Monday..Sunday]
[
    "Monday",
    "Tuesday",
    "Wednesday",
    "Thursday",
    "Friday",
    "Saturday",
    "Sunday"
]

Please note that as per the first example, all arrays generated by ja are arrays of strings - even if you’re command is ranging over integers.

Detail

Please read the documentation on a for a more detailed breakdown on of ja’s supported features.

See Also


This document was generated from builtins/core/mkarray/array_doc.yaml.

This site's content is rebuilt automatically from murex's source code after each merge to the master branch. Downloadable murex binaries are also built with the website.

Last built on Sat Nov 23 00:50:15 UTC 2024 against commit 69c17da69c17da3bd9db98ca508f6a03a402f074ee24cec.

Current version is 6.4.0375 (develop) which has been verified against tests cases.