In the fill example, you are creating a single array pointing to some memory on the heap. This is passed into the fill function and sets every element pointing at that same array.
To get what you want, you have to create a new array for each element, e.g. with a list comphrension:
The Julia documentation for the fill() covers this explicitly. ?fill in the Julia REPL will show you this. It is also available
in the online Julia documentation.