Flatten an array one level javascript