Compare Two Object Array In Javascript Functions With Parameters