I have this JS:
let streetNumber = document.getElementById('street_number').value;
let postalCode = document.getElementById('postal_code').value;
let country = document.getElementById('country').value;
But it's very repetitive and not really DRY in my opinion. What I would love is something like this (because I have the array available):
let arr = ["street_number", "postal_code", "country"];
for (entry of arr) {
let entry = document.getElementById(entry).value;
}
Basically just creating JS variables for each of the input values extracted from the HTML input field.
How can I achieve this?