Loops
Qus. 1 : Which loop is guaranteed to execute at least one time, regardless of the condition?
- for loop
- while loop
- do-while loop
- None of the above
- for (i = 0; i < 5; i++) { // code }
- for (i <= 5; i++) { // code }
- for i = 1 to 5 { // code }
- for (i = 0; i < 5) { // code }
- break statement stops the loop, and continue skips the current iteration
- continue statement stops the loop, and break skips the current iteration
- Both break and continue stop the loop
- Both break and continue skip the current iteration
- Yes, but only two levels deep
- No, nesting loops is not allowed
- Yes, we can nest any number of loops
- Yes, but only with for loops
- for loop
- while loop
- do-while loop
- foreach loop
- 0 1 2
- 1 2 3
- 0 1 2 3
- 1 2
Programs
JavaScript script to display the current day and time in the following format
JavaScript function to extract unique characters from a string
Write a JavaScript program which accept a string as input and swap the case of each character.
calculator program in javascript
JavaScript code to print current date in dd mon year format