Web Development · module 6 of 13

JavaScript Fundamentals

Work with variables, values, operators, conditions, loops, functions, scope, arrays, and objects.

Course map
global — const sitefunction outer() — let count = 0function inner() { count += 1;}looking up count1. inner — not here2. outer — found it3. global — never reachedThe search goes outwardsonly, never inwards.inner keeps its grip on outer's variables even after outer has returned — that is a closure.
JavaScript Fundamentals — the idea in one picture

What this module covers

5 steps · Web Development

  1. Step 1. Lesson: JavaScript Fundamentals

    Work with variables, values, operators, conditions, loops, functions, scope, arrays, and objects. Learning objectives - Recognize when javascript fundamentals is the right tool. - Explain the role of const, function, return. - Build a small working example before combining it with a larger interface. - Identify one accessibility, maintainability, or error-handling improvement. Read the example, predict what it will do, then complete the small change described in the check question.

    Work with variables, values, operators, conditions, loops, functions, scope, arrays, and objects. In Web Lab, make the state/interaction visible in the UI so completion is easy to verify.

    Check yourself: [Web Lab] Use the example to demonstrate javascript fundamentals.

  2. Step 2. Quiz: JavaScript Fundamentals

    Check your understanding of JavaScript Fundamentals.

    return ends the current function call and provides its result to the caller. In Web Lab, make the state/interaction visible in the UI so completion is easy to verify.

    Check yourself: [Web Lab] Complete the knowledge check.

  3. Step 3. Exercise: JavaScript Fundamentals

    Write functions that calculate a total, average, highest value, and a pass/fail result from an array of scores.

    This exercise turns the JavaScript Fundamentals lesson into a working code change. In Web Lab, make the state/interaction visible in the UI so completion is easy to verify.

    Check yourself: [Web Lab] Does the solution use const and function and return?

  4. Step 4. Review lab: Explain & improve JavaScript Fundamentals

    Rebuild the exercise without copying the solution. Then improve it in two ways: make the code easier to understand and add one useful edge case, responsive behavior, accessibility improvement, or error state. Finally, write a short explanation of how const, function, return work together.

    Rebuilding from memory and improving an edge case turns recognition into durable skill. In Web Lab, make the state/interaction visible in the UI so completion is easy to verify.

    Check yourself: [Web Lab] Does the improved version still use const, function, return clearly?

  5. Step 5. Mini project: JavaScript Fundamentals

    Build a command-style grade analyzer that validates input and reports totals, averages, grades, and useful messages.

    The mini project combines the module lesson, quiz, and exercise into one portfolio-ready result. In Web Lab, make the state/interaction visible in the UI so completion is easy to verify.

    Check yourself: [Web Lab] Does the project apply the module's javascript fundamentals skills?

Loading code lab...