In PHP, there var_dump & print_r such a good stuff, Then bring into javascript.