JS3 ClassNotes
JS3 ClassNotes
for Loop
console.log("apna college");
}
Loops in JS
Infinite Loop : A Loop that never ends
Loops in JS
while Loop
while (condition) {
// do some work
}
Loops in JS
do-while Loop
do {
// do some work
} while (condition);
Loops in JS
for-of Loop
}
Loops in JS
for-in Loop
}
Let‘s Practice
Qs1. Print all even numbers from 0 to 100.
Let‘s Practice
Qs2.
Create a game where you start with any random game number. Ask the user to keep
guessing the game number until the user enters correct value.
Strings in JS
String is a sequence of characters used to represent text
Create String
String Length
str.length
String Indices
String Interpolation
str.toUpperCase( )
str.toLowerCase( )
str.charAt( idx )
Let‘s Practice
Qs1. Prompt the user to enter their full name. Generate a username for them based on the input.
Start username with @, followed by their full name and ending with the fullname length.