Answers for ".find({})"

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

(this).find

$('article a').click(function() {
    $(this).parent().find('h3').slideToggle('fast');
});
Posted by: Guest on September-23-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language