if (hour < 18) {
greeting = "Good day";
}
<script>
var a=20;
if(a%2==0){
document.write("a is even number");
}
else{
document.write("a is odd number");
}
</script>
for( i = 0 ; i < 8 ; i++ ){
document.write( i + "<br>" );
}
<!DOCTYPE html>
<html>
<body>
<h1>JavaScript Global Methods</h1>
<h2>The String() Method</h2>
<p>String() converts a value to a string:</p>
<p id="demo"></p>
<script>
document.getElementById("demo").innerHTML =
String(new Date()) + "<br>" +
String("12345") + "<br>" +
String(12345);
</script>
</body>
</html>
const cars = [];
cars[0]= "Saab";
cars[1]= "Volvo";
cars[2]= "BMW";