A
A
Arsen002020-06-21 18:36:59
JavaScript
Arsen00, 2020-06-21 18:36:59

How to create an attribute for objects in an array?

Hello, I'm wondering if it's possible to assign attributes to array elements.

There is an array:

const Karten = [
    'Karten/MemoryCard1.jpg',
    'Karten/MemoryCard2.jpg',
    'Karten/MemoryCard3.jpg',
    'Karten/MemoryCard4.jpg',
  'Karten/MemoryCard5.jpg',
  'Karten/MemoryCard6.jpg',
  'Karten/MemoryCard7.jpg',
  'Karten/MemoryCardBackside.jpg'
];


And for each element, I would like to assign an individual attribute (let's say data). Is it possible? If yes, please tell me how?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Peter, 2020-06-21
@Arsen00

So?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question