Refactored compare.js to use a makeshift 'spaceship' operator, simplified sendAction in component.js

I'm not a fan of multiple statements in each of the for loop initialization parts. The performance is the same since the value of the length property is cached. Also I wanted to rename the variable 'l' in the array case to 'len' but then i noticed that it was already being used here.