Posts by Romulo Pires • 34 points
1 post
-
1
votes3
answers128
viewsA: Map with dynamic array and property
The problem with your example is that prop as a string does not directly reference an object attribute name. You can try to do so: const getProperties = (array, prop) => array.map((element) =>…