Elementi select iz matrike v Reactu

Recimo, da imamo matriko z besedili elementov spustnega seznama:

jsxfunction App() {
  const texts = ['text1', 'text2', 'text3', 'text4'];
  const [value, setValue] = useState('');
  
  return <div>
    ...
  </div>;
}

Ustvarimo naše oznake option v zanki:

jsxfunction App() {
  const texts = ['text1', 'text2', 'text3', 'text4'];
  const [value, setValue] = useState('');
  
  const options = texts.map((text, index) => {
    return <option key={index}>{text}</option>;
  });
  
  return <div>
    <select value={value} onChange={(event) => setValue(event.target.value)}>
      {options}
    </select>
    <p>
      vaša izbira: {value}
    </p>
  </div>;
}
Задание 1

Recimo, da se v matriki shrani seznam mest. S pomočjo zanke prikažite spustni seznam teh mest.