Javascript Strings and Arrays Assignment