Members

Blog Posts

Asthma in Babies: The Common Signs and Treatment

Posted by priyankasharma on April 25, 2024 at 2:17am 0 Comments

Asthma is a chronic disease of the lungs. If a child has asthma, it typically affects their ability to breathe correctly. The disease is more likely to occur if one or more parents are experiencing asthma or if there is a family history of food allergies or eczema. According to Dr. Promilla Butani, a general pediatrician in South Delhi, if a child has asthma, it is essential to work with a pediatrician to… Continue

ES6 introduced many new methods built into the Array prototype. These methods allow you to interact with the data in your arrays in different ways, like transforming each item (map), sorting an array, or filtering an array. My favorite array methods that I use commonly in Vue apps are filter, map, forEach, and includes. Here’s an example using filter:

computed: {
// Without "filter" functional array method
oldFilteredItems() {
const filtered = []
for (const item in this.items) {
if(item.value > 10) {
filtered.push(item)
}
}
return filtered
},
// With "filter" functional array method
filteredItems() {
return this.items.filter((item) => item.value > 10)
}
}
This reduces the code we have to write (and read!) from seven lines to only one!

Read more: https://itmaster-soft.com/en/vue-js-development-services

Views: 7

Comment

You need to be a member of On Feet Nation to add comments!

Join On Feet Nation

© 2024   Created by PH the vintage.   Powered by

Badges  |  Report an Issue  |  Terms of Service