JavaCroco

Comparison Operators

Evaluating Conditions:

EV1 EV2

Using comparision operators:

Example:

var pass = 50;  // Pass mark
var score = 90; //Score

// Check if the user has passed
var hasPassed = score > = pass ;

// Write the message into the page
var el = document.getElementByl('answer');
e1.textContent = 'Leve 1 passed: ' + hasPassed;

Loops :

Loops

Loop counters and For Loops:

LC

Using While loops:

Example:

Example

Using Do While loops:

Example:

Example

References:

Main page