i have this code and i want to get a new array with the href attribute of each element in the array; maybe there is a different way to do it
let countries = document.querySelectorAll('.el');
let countriesList = Array.prototype.slice.call(countries);
let arra = countriesList.map(link);
function link() {
for(let i = 0; i < countriesList.length; i++) {
countriesList[i].getAttribute('href');
}
}
console.log(arra)
<div>
<a class='el' href='italy.php'>Italy</a>
<a class='el' href='france.php'>France</a>
<a class='el' href='japan.php'>Japan</a>
<a class='el' href='china.php'>China</a>
</div>