Function to stop js confusing strings and arrays