Handling weird syntax of javascript array.