jeudi 31 mai 2018

Jquery Array.find() not working

I am using ASP.NET MVC 5 and Jquery 3.3.1. I have the following code:

var r =   $("#MultiSelectDialog_List").attr("data-object");

where r is an array of objects. I am trying to find and object by ID so I wrote:

r.find(x => x.ID == "5").ID;

but when debugging in the browser,an error is thrown (find is not a function) also the intellisense does not show the find() but shows all other JQuery functions




Aucun commentaire:

Enregistrer un commentaire