If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

## AP®︎/College Computer Science Principles

### Course: AP®︎/College Computer Science Principles>Unit 9

Lesson 2: Learn AP CSP exam pseudocode

# AP CSP pseudocode vs. JavaScript

Since AP CS Principles is taught with a variety of programming languages, the AP CSP exam questions use a pseudocode that represents fundamental programming concepts.
You can see the full pseudocode reference online here or on page 205 of the College Board AP CSP exam description.
There are many differences between the AP CSP pseudocode and the JavaScript language syntax.
This table highlights the biggest differences:
ConceptPseudocodeJavaScript
Assignment`a ← expression``var a = expression;`
Equality`a = b``a == b`
Inequality`a ≠ b``a != b`
Repetition`REPEAT n TIMES``for (var i = 0; i < n; i++)`
Repetition`REPEAT UNTIL (condition)``while (condition)`
List index`list[1]` is first item`list[0]` is first item
List iteration`FOR EACH item IN list``for (var i = 0; i < list.length; i++)`
To make sure you understand the pseudocode, practice using it in the exercises from our Programming and Algorithms units.

## Want to join the conversation?

• when will there be a full moon?
• A `while` loop is run while the provided condition is true. However, if your condition describes the criteria for ending the `while` loop, then `while (!condition)` would be fitting, like you say.