Table of Contents
The `map()` function allows you to transform elements in an array by applying a function to each element and producing a new array with the results. This function is vital for transforming data and often used in the React ecosystem for rendering lists.
`filter()` creates a new array with all elements that pass a specified test. It’s beneficial when you need to selectively operate on elements from an array.
`reduce()` is a powerful function that allows you to compute a single value from an array. This function is vital when you need to summarize or transform an entire array into a single value.
`forEach()` method is used to execute a provided function once for each array element. This function is commonly used when you need to do something with each item in an array but don’t need to create a new array.
5. Object.keys() and Object.values()
These methods are handy for working with objects. `Object.keys()` returns an array of a given object’s keys, while `Object.values()` gives an array of its corresponding values.
6. setTimeout() and setInterval()
`setTimeout()` allows you to delay the execution of a function by a specific number of milliseconds, while `setInterval()` will execute a function repeatedly at a set time interval until it’s stopped.
7. Promise and Async/Await
8. encodeURIComponent() and decodeURIComponent()
These are used to encode and decode URI components. They are crucial when working with query parameters, especially when these may include special characters.
9. JSON.stringify() and JSON.parse()
The `bind()` method creates a new function that, when called, has its `this` keyword set to the provided value. It’s especially important in React when you need to preserve context.