<ul class="menu">
<li class="first">1</li>
<li>2</li>
<li>3</li>
<li>4</li>
<li class="last">5</li>
</ul>
const menu = document.querySelector('.menu')
console.log(menu.firstElementChild)
console.log(menu.children[2])
console.log(menu.lastElementChild)
console.log(menu.children[menu.children.length-1])