JavaScript/Self Test

You can test yourself by answering the following questions. When in doubt, you should undertake a test in your development environment (editor, IDE, browser). So it's also a test of whether you have installed all the necessary tools to execute the examples of the Wikibook.

Introduction
{Inside which HTML element do you put the JavaScript code? - - - Yes + No
 * type=""}
 * type=""}
 * A variable can hold values of different types (at different times).
 * A variable can hold values of different types (at different times).

Syntax and Semantic
{Is there a syntax error? + Yes - No
 * type=""}

{Is there a syntax error? + Yes - No
 * type=""}

{Which line contains a syntax error? - Line 1 - Line 2 - Line 3 - Line 4 + None of the above
 * type=""}

{Which lines contain a syntax error? - Line 1 - Line 2 - Line 3 - Line 4 + None of the above
 * type="[]"}
 * It's perfectly correct when strings contain non-latin characters
 * It's perfectly correct when strings contain non-latin characters

{Which line leads to an error message? - Line 1 - Line 2 - Line 3 + Line 4 - None of the above
 * type=""}

{Which line leads to an error message? - Line 1 + Line 2 - Line 3 - Line 4 - None of the above
 * type=""}
 * In opposition to usual algebra in mathematics, you cannot omit the multiply operator.
 * It's correct: like multiplication with -1.

{Which line(s) leads to an error message? - Line 1 - Line 2 - Line 3 - Line 4 + Line 5 - Line 6 - None of the above
 * type="[]"}
 * It assigns an array to x. This array contains the two arrays [1] and [2] (containing one 'Number' each).

{Is there a syntax error? + Yes - No
 * type=""}

{Which line contains a syntax error? - Line 1 - Line 2 + Line 3 - Line 4 - None of the above
 * type=""}
 * The Numbers 1 and 2 are added. The result is compared with the Number 3. The comparison leads to a Boolean result.

Type Conversion
{Which message(s) will not be shown? - 3 - 12 - -1 + All will be shown.
 * type="[]"}
 * Depending on the context, the character '+' is an operator to add Numbers or to concatenate strings (possibly after type conversion). The character '-' subtracts Numbers (possibly after type conversion, which is what happens here).
 * In the last line, a type conversion takes place. Then, the subtraction is performed.

{What message(s) will not be shown? + Error Message - true - false - 5 - 1
 * type="[]"}

Loops
{What will be the result in ? The result in sum will be { 10 _3 }.
 * type="{}"}
 * Consider the cutting edges of the iteration: the first is 1, and the last is 4.

{What will be the result in ? The result in sum will be { 5 _2 }.
 * type="{}"}
 * The addition is only done when  is equal to  . Therefore   is always   and can be ignored.

{Is there a syntactical error? + Yes - No
 * type=""}
 * The first  statement misses the   character but uses the  . Missing both is possible as long as the block consists of exactly 1 statement.
 * The first  statement misses the   character but uses the  . Missing both is possible as long as the block consists of exactly 1 statement.

{What will be the result? - 0 - 6 + Infinite loop - None of the above
 * type=""}
 * The comparison operator is  or  . The   is an assignment. JavaScript executes the assignment and interprets its result as.