jq samples

outputs adjusted formatting-wise for legibility and clarity

string of a number to array of digits as integers

echo \"01230\" | jq 'split("")|map(tonumber)'
[ 0, 1, 2, 3, 0 ]

string of a number to array of object with the digits as integers and their positions from end

echo \"01230\" | jq 'split("")|reverse|to_entries|reverse|map({key, value: .value | tonumber})'

[ { "key": 4, "value": 0 },
  { "key": 3, "value": 1 },
  { "key": 2, "value": 2 },
  { "key": 1, "value": 3 },
  { "key": 0, "value": 0 } ]

See also