The console.log() method outputs a message to the web console. Read the tutorial and learn the simplest method of putting a single or multiple styles to it.
You can either loop through the arrays or convert them to string and then compare. This tutorial provides several fast methods of comparing two arrays.
If you want to get a proper explanation of how to convert a PHP object to an associative array, you are in the right place. Just follow the examples.