manipulação de array javascript
const produtos = [ { id: 1, categoria: 'limpeza', name: 'Amaciante' }, { id: 2, categoria: 'limpeza', name: 'Detergente' }, { id: 3, categoria: 'alimento', name: 'ovo' }, { id: 4, categoria: 'alimento', name: 'alface' },];const idsAlimentos = produtos .filter(p => p.categoria === 'alimento') // inline .map(p => p.id);console.log(idsAlimentos); // [3, 4]
Also in JavaScript:
- javascript 1 + "1"
- javascript object
- js date difference in seconds
- html how to hide and show multiple
- how to read json file in C#
- react detect cursor
- javascript add row to table
- react can only work with node and express? true or false
- loading screen fivem js
- nodejs current timestamp
- javascript replace
- fortuna based rng js
- get current date javascript full month
- -d {followingjson} curl
- class component react
- Object as a Function
- jquery add option to select
- === in js
- add table row jQuery
- make nextjs project
- how to wait till jquery post request has been made
- jquery element width
- generate random number javascript
- cypress disabled