It's possible that I'm not properly using jQuery's inArray()
function, but I have to construct an object that only has the indexes of two other JavaScript objects where the values match exactly:
var arr1 = {
a: "alfa",
b: "beta"};
var arr2 = {b: "beta"};
alert(jQuery.inArray(arr2, arr1));
Here, I expect to get an object that contains only:
{b: "beta"}
Similarly, if the arrays looked like this:
var arr1 = {
a: "alfa",
b: "beta",
c: "test"};
var arr2 = {b: "beta",
c: "not the same value"};
I would still expect:
{b: "beta"}
Because the values in the c
index are not exactly the same.
Thanks in advance, ciao h.