javascript - check if value exists in 2D array -



javascript - check if value exists in 2D array -

i have 2d array in format

emi_309 | nowadays | weak | 6 emi_310 | nowadays | strong | 9 emi_319 | nowadays | medium | 8 emi_315 | nowadays | weak | 5

i want check if value exists in first column using simple function

e.g, check if emi_77 exists in first column

i came across $.inarray(value, array) function 1d array only.

is there similar 2d array

yes, if combination of $.inarray , $.map:

if ($.inarray(value, $.map(arr, function(v) { homecoming v[0]; })) > -1) { // ... }

javascript jquery

Comments

Popular posts from this blog

web services - java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.proxy.Enhancer -

Accessing MATLAB's unicode strings from C -

javascript - mongodb won't find my schema method in nested container -