//последний и единственный else
}else{
const nodes = [...template.querySelectorAll('input')];
const names = nodes.map(n=>n.name).join();
console.log( names );
for(let valueKey in contact.contact_value){
//console.log(contact.contact_type, valueKey)
let selector = `[name*="${valueKey}"]`;
//let valueInput = template.querySelector(selector);
let valueInput = nodes.filter(i=>i.name.indexOf('['+valueKey[0])>0).pop();
console.log( names.indexOf( '['+valueKey[0] ), valueKey, valueInput );
//console.log( selector, valueInput );
if(valueInput) valueInput.value = contact.contact_value[valueKey]
contactList.appendChild(template)
}
}