INTERACTIVE COURSE · FREE

Operators and expressions in JavaScript: calculate and evaluate requirements

Build calculations, update values, and combine comparisons with Boolean logic. Learn to use parentheses and check a purchase and its promotion without conditional structures.

Level
Beginner
Lessons
5
Learning steps
77
UNDERSTAND · PRACTISE · APPLY

Your lesson journey

Each lesson has a purpose. Follow the order or revisit an idea you want to practise.

5 lessons

5 of 5 lessons shown

The numbers show the lesson order, not your progress.

What you will learn

Distinguish operators, operands, expressions, and statements. Use +, -, *, /, %, and ** with numeric data and explain their results. Update variables through compound assignment and interpret simple increments and decrements. Compare with >, <, >=, <=, ===, and !== and separate comparison from assignment. Combine and negate Boolean expressions with &&, ||, and ! without conditional structures. Explain short-circuiting and recognize that && and || do not always return Boolean. Use precedence, parentheses, and intermediate results to communicate intention. Build and check a purchase and promotion program, detecting operation, grouping, and requirement errors.

Before you start

Have completed courses 01 through 06 of Programming Fundamentals or know their content. We use let, const, console.log, basic types, typeof, explicit conversions, template literals, and desk checks. No prior formal knowledge of comparison operators, logic, or precedence is required. Exercises use valid fictional inputs and independent programs without installations.

COURSE CONTEXT

About this course

Read the full description

Course 07 of Programming Fundamentals from Código con Criterio. In five lessons you will learn to choose arithmetic operators, abbreviate updates, compare values, and combine requirements through readable expressions.

Codi accompanies worked examples, truth tables, value tracing, activities with hints, and labs. Calculations are distinguished from assignments and comparisons; the effect of an update is also distinguished from the expression returning its value.

Comparisons prioritize strict equality and inequality. Logic is first taught with Boolean, with a brief reference to short-circuiting and non-Boolean results. Precedence and parentheses are related to grouping without claiming they force every expression to be evaluated.

The final challenge calculates a purchase of two products, updates a quantity before calculation, subtracts a fixed discount, and evaluates explicit promotional rules on the final amount. It includes a reference, tracing, variations, and deliberate errors. Activities check understanding; labs and free-form explanations receive no automatic correction.

No installations, if, else, ternary selection, loops, arrays, objects, or custom functions are required. Numbers and Boolean results are displayed without executing different actions based on their conditions.

CONNECT YOUR LEARNING

This course is part of these learning paths

Follow the suggested order or take this course on its own.