Filter Substring from JSON in JQuery

JSON –

"offers": [           
    {
        "loanType": "432321CMP",
    },
    {
        "loanType": "788407CMP",
    },
    {
        "loanType": "97934OOW",
    },
    {
        "loanType": "8293EWC-AS",
    },
    {
        "loanType": "6653EWC-AS",
    }
]

I want to filter data basis the substring in the end ["EWC-AS", "CMP"]

    myArrayFiltered = offers.filter(function(v) {
        return (["EWC-AS"].indexOf(v.loanType)) > -1;
    });

if I pass on the exact value to match it works, but for subtring it does not.

Thanks in Advance for the help

184 thoughts on “Filter Substring from JSON in JQuery”

  1. Pingback: canadian viagra
  2. Pingback: generic for viagra
  3. Pingback: viagra pill
  4. Pingback: viagra buy online
  5. Pingback: buy cialis online
  6. Pingback: cialis canada
  7. Pingback: cialis uk
  8. Pingback: viagra generic
  9. Pingback: sildenafil 50mg
  10. Pingback: viagra 100
  11. Pingback: cialis best price
  12. Pingback: viagra 100mg
  13. Pingback: cialis walmart
  14. Pingback: cialis pills
  15. Pingback: canadian cialis
  16. Pingback: viagra
  17. Pingback: buy cialis euro
  18. Pingback: doctor x viagra
  19. Pingback: viagra kaufen
  20. Pingback: generic viagra
  21. Pingback: viagra vs cialis
  22. Pingback: herbal viagra
  23. Pingback: viagra for women
  24. Pingback: roman viagra
  25. Pingback: walmart viagra
  26. Pingback: generic sildenafil
  27. Pingback: female viagra pill
  28. Pingback: viagra substitute