how to use classes with maps in javascript code example
Example 1: map in js
//map() methods returns a new array
const data = {name: "laptop", brands: ["dell", "acer", "asus"]}
let inside_data = data.brands.map((i) => {
console.log(i); //dell acer asus
});
Example 2: javascript map
The map() method creates a new array with the results of calling a provided function on every element in the calling array.