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: 
Yes. Use the `-n` option:

```
echo -n "$x"

```

From `help echo`:

> 
> -n do not append a newline
> 
> 
> 

This would strips off the last newline too, so if you want you can add a final newline after the loop:

```
for ...; do ...; done; echo

```

---

**Note:**

This is not portable among various implementations of `echo` builtin/external executable. The portable way would be to use `printf` instead:

```
printf '%s' "$x"

```
You can also do it this way:

```sh
array=(1 2 3 4 5)
echo "${array[@]}"

```