- Create a variable of type string and try to add a number to it.
- Create a variable of type string and try to add a number to it. And use typeof operator to find the datatype of the string in last question.
- Create a const object in JavaScript. Can you change it to hold a number later?
- Try to add a new key to the const object. Were you able to do it?
- Write a JavaScript program to create a word-meaning dictionary of 5 words.
- Use logical operator to find whether the age of a person lies between 10 and 20.
- Demonstrate the use of switch case statements in JavaScript.
- Write a JavaScript program to find whether a number is divisible by 2 and 3.
- Write a JavaScript program to find whether a number is divisible by 2 or 3.
- Print "You can drive" or "You cannot drive" based on age being greater than 18 using ternary operator.
- Write a program to print the marks of a student in an object using for loop: obj = {harry:98, rohan:70, aakash:7}
- Write a program to print the marks of a student in an object using for...in loop: obj = {harry:98, rohan:70, aakash:7}
- Write a program to print "try again" until the user enters the correct number.
- Write a function to find mean of 5 numbers.
- What will the following print in JavaScript?
- Explore the includes, startsWith(), endsWith() functions of a string.
- Write a program to convert a given string to lowercase
- Extract the amount out of this string "Please give Rs1000".
- Try to change 4th character of a given string. Were you able to do it?
- Create an array of numbers and take input from the user to add numbers to this array.
- Create an array of numbers and take input from the user to add numbers to this array. Keep adding numbers to the array until 0 is added to the array.
- Create an array of numbers and take input from the user to add numbers to this array. Filter for numbers divisible by 10 from a given array.
- Create an array of numbers and take input from the user to add numbers to this array. Create an array of space of given numbers.
- Use reduce to calculate factorial of a given number from an array of first n natural numbers (n being the number whose factorial needs to be calculated).
- Write a program using prompt function to take input of age as a value from the user and use alert to tell him whether he can drive!
- Write a program using prompt function to take input of age as a value from the user and use alert to tell him whether he can drive! Use confirm to ask the user if he wants to see prompt again.
- Write a program using prompt function to take input of age as a value from the user and use alert to tell him whether he can drive! Use confirm to ask the user if he wants to see prompt again. Use console.error to log error if the age entered is negative.
- Write a program to change the url to google.com (Redirection) if user enters a number greater than 4.
- Change the background of the page to yellow, red or any other color based on user input through prompt.
- Create a navbar and change the color of its first element to red.
- Create a table without tbody. Now use 'view page source' button to check whether it has a tbody or not.
- Create an element with 3 children. Now change the color of first and last element to green.
- Write a JavaScript code to change background of all <li> tags to cyan.
- Which of the following is used to look for the farthest ancestor that matches a given CSS selector?
- Write a program to show different alerts when different buttons are clicked.
- Create a website which is capable of storing bookmarks of your favorite websites using href.
- Create a website which is capable of storing bookmarks of your favorite websites using event listeners.
- Write a JavaScript program to keep fetching contents of a website (every 5 seconds).
- Create a glowing bulb effect using classlist toggle method in JavaScript.