LDLize du Plessisinlizeduplessis.hashnode.dev·Jun 15, 2022 · 1 min readUse the map() function in React to display items in DOMWe have an array of objects called cats. We want to display the cats' names as an unordered list in the DOM. import React from "react"; function App() { const cats = [ { name: "Nanny" }, { name: "Minki" }, { name: "Bread" }, { name...02DA
LDLize du Plessisinlizeduplessis.hashnode.dev·Jun 15, 2022 · 1 min readThe find() method in JavaScript for beginners(╯°□°)╯ .find() The find() method is useful when you would like to get data considered true in your condition. Example 1 Here is an array of numbers. I am looking for the number bigger than 6. const numbers = [2, 4, 6, 8]; const biggestNum = number...01S
LDLize du Plessisinlizeduplessis.hashnode.dev·Jun 8, 2022 · 2 min readJavaScript sort() method for beginners(╯°□°)╯ .sort() The sort() function is used to sort data within an array or an array of objects. Example 1 When you want sort numbers from lowest to highest. It is as easy as just using the .sort() function . This is an array of numbers. const num =...00
LDLize du Plessisinlizeduplessis.hashnode.dev·Jun 6, 2022 · 1 min readJavaScript map() Method for beginners(╯°□°)╯ .map() The map() array method manipulates data and returns a new array of changed data. Example 1 We have an array of objects called dogs. { name: "Spike", age: 5, vaccinated: true, breed: "Border Terrier", li...00
LDLize du Plessisinlizeduplessis.hashnode.dev·Jun 6, 2022 · 1 min readJavaScript filter() method for beginners(╯°□°)╯ .filter() We use this function in JavaScript to return a new array from the items matched true from the condition passed in the function. Example 1 const myArray = [1, 2, 3, 4]; const newArray = myArray.filter((num) => num >= 2); // [ 2, 3,...00