Introduction:
Here I will explain how to use jQuery to add items or elements to an array if not exists in list with example. By using inArray property we can check whether elements exists or not in array using jQuery.
Description:
In previous articles I explained jQuery currency exchange rate example with google api, jQuery referesh div without reloading page, jQuery delete row from gridview and database in asp.net, jQuery check if string contains specific text or not and many articles relating to AngularJS, jQuery, JavaScript and asp.net. Now I will explain how to add items to an array if not exists in array with example in jQuery.
In previous articles I explained jQuery currency exchange rate example with google api, jQuery referesh div without reloading page, jQuery delete row from gridview and database in asp.net, jQuery check if string contains specific text or not and many articles relating to AngularJS, jQuery, JavaScript and asp.net. Now I will explain how to add items to an array if not exists in array with example in jQuery.
By using inArray property we can add items to an array if not exists in jQuery
for that we need to write the code like as shown below