I am using map JavaScript function to return an object. row.id
throws error . I want to create id as key for every iteration in array.
<input value="3" id="first" class="pdate">
<input value="5" id="second" class="pdate">
<input value="2" id="third" class="pdate">
if(document.querySelectorAll('.pdate')){
let update = [...document.querySelectorAll('.pdate')].map(row => {
return {
row.id : row.value
}
})
}