Javascript link

Hello everybody, I am working on frontend project from, and we are required to create dynamic link with javascript. This links will connect to the section of the land page. It also has to scroll the particular page. I have been having a hard time with this project and I need some help. I have already created the links using html and css. The best I could is this:

function pagebar(){

  let links=document.getElementById("Navbar")

  let current = location.href;

  for (var i=0; i < links.length; i++){

    let linkSection = "I dont know what to do next"



tip: before you write any code at all, write out all the steps you need to go through in plain english using comments. coding should be the very last thing you do only after its clear what you have to do.

would you mind you copying your project to codepen and pasting your link here?

Topic: Use javascript to create a dynamic navigation links for landing page, that enable users scroll to the particular section of the landing page.

My approach:

  1. set the the dom variable for the navbar.
    const navbar=document.getElementById(‘navBar’);
  2. create a for loop to loop through the navbar
  3. for each loop create an anchor ('a) and create a list (li)
  4. Append the anchor to the link
  5. I am stuck. Dont know how to actually add the specific url address to each specific link and append them to the landing page