DEV Community

benboorstein
benboorstein

Posted on

Quick Notes Based On "Learning JavaScript Exercise" Section of Frontend Masters' "Complete Intro to Web Development, v2"

What I did (in code):

    const character = 'a'
    const timesRepeated = 50
    let answer = ''

    for (let i = 0; i < timesRepeated; i++) {
       answer += character
    }

    console.log(answer)
    console.log(answer.length)

    Logs: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
    Logs: 50

What I did (in English):

  • Assign the string 'a' to the variable character.
  • Assign 50 to the variable timesRepeated.
  • Assign '' (an empty string, i.e., a string with a length equal to 0) to the variable answer.
  • The for loop: Set the variable i to start at 0, run the loop as long as i is less than timesRepeated, and at the end of each iteration of the loop, increment i by 1. Each iteration of the loop, store answer + character in answer (i.e., update answer).
  • Log to the console answer.
  • Log to the console answer.length.

What I practiced:

  • Same as above.

What I learned:

  • From the above code, I didn't learn anything new.
  • For this section, there was no instruction outside of the exercise itself.

What I still might not understand:

  • Nothing for this section.

Build gen AI apps that run anywhere with MongoDB Atlas

Build gen AI apps that run anywhere with MongoDB Atlas

MongoDB Atlas bundles vector search and a flexible document model so developers can build, scale, and run gen AI apps without juggling multiple databases. From LLM to semantic search, Atlas streamlines AI architecture. Start free today.

Start Free

Top comments (0)

JavaScript-ready auth and billing that just works

JavaScript-ready auth and billing that just works

Stop building auth from scratch. Kinde handles authentication, user management, and billing so you can focus on what matters - shipping great products your users will love.

Get a free account

[Workshop] Building and Monitoring AI Agents and MCP servers

Building with AI is different. Sentry has built some tools to help. In this workshop, you’ll learn how to monitor your agents, debug your MCP servers and how to debug with Seer.

Tune in to the full event

DEV is partnering to bring live events to the community. Join us or dismiss this billboard if you're not interested. ❤️