if (lastPin === diary) { console.log('The diary page card is already pinned.'); return; } console.log('No diary page card found. Creating it....') const pin = lastPin.cloneNode(true) pin.style.opacity = 0.7 console.log('The new pinned card: %o',pin) $('a', pin).href = path $('.title', pin).textContent = today $('.description', pin).innerHTML = '' (lastPin ?? actualLastPin)?.after(pin)