Question: I have my empty array

```
const arr = [];

```

I want to push 2 things. 1.) a numerical value and 2.) an object

```
data.push('id':id, 'obj':storedObj);

```

This throws `Unexpected type cast`. I was curious if something like this was do-able?

Answer: 
```
printf '%s\n' "${array[@]}" | sort | tr '\n' ' '

```

`printf '%s\n'` -- more robust than `echo` and you want the newlines here for `sort`'s sake
`"${array[@]}"` -- quotes unnecessary for your particular array, but good practice as you don't generally want word-spliting and glob expansions there
If, for whatever reason, `-n` doesn't fix this for you, you can also add `\c` to the end of the thing to be echo'd:

```sh
echo "$x\c"

```