You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

index.js 215 B

1234567
  1. export const getListValueWithKey = (list, key, k = 'k', v = 'v') => {
  2. for (let i = 0, iLen = list.length; i < iLen; i++) {
  3. const listI = list[i];
  4. if (listI[k] === key) return listI[v];
  5. }
  6. return '';
  7. };