@Richard
It's not a big difference. Just a good idea to get in to the habit of writing functions to do specific things, rather than lumping it into your game logic, as @PB____ has said.
Really, the benefit comes when you pass it an array. For example:
function changeElement( list, row, column, value )
var newList = list
newList[row][column] = value
return newList
myArray = [
[1, 1, 1, 1],
[1, 1, 1, 1],
[1, 1, 1, 1]
]
// change row 1 column 3 of myArray to value 10
myArray = changeElement( myArray, 1, 3, 10 )
Now you could pass any old two dimensional array into that function and it will give you back a modified version of that array with the new value. You could update the old one with this, as in the example, or you could create a copy, etc.
This way you wouldn't need to bother writing the array access every time you wanted to change something. Just call your function.
If you're going to do the same type of thing more than once, it's generally best practise to make a function to do it, and pass the things you need into it.
Of course there's always more than one way to skin the proverbial cat. Sometimes it won't be worth bothering with!