Answers for "jquery search in array"

4

search functionality in jquery

<input id="search-date1" class="pull-right" value="" placeholder="Search Material" type="text"/>
  $('#search-date1').keyup(function(){
  var value = this.value.toLowerCase();
  $('.modal_iterator_row').each(function(){
    var id = $(this).text().toLowerCase();
    $(this).toggle(id.indexOf(value) !== -1);
  })
});
Posted by: Guest on April-12-2021
50

javascript find

const inventory = [
  {name: 'apples', quantity: 2},
  {name: 'cherries', quantity: 8}
  {name: 'bananas', quantity: 0},
  {name: 'cherries', quantity: 5}
  {name: 'cherries', quantity: 15}
  
];

const result = inventory.find( ({ name }) => name === 'cherries' );

console.log(result) // { name: 'cherries', quantity: 5 }
Posted by: Guest on July-11-2020
0

jquery in array

function isInArray(value, array) {
return array.indexOf(value) > -1;
}
Posted by: Guest on February-18-2021
0

jquery check if value is in array

$.inArray( 5 + 5, [ "8", "9", "10", 10 + "" ] );
Posted by: Guest on November-13-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language