JavaScript basic
1. Write a JavaScript program to determine whether a given year is a leap
year in the Gregorian calendar.
2. Write a JavaScript program to get the website URL (loading page).
3. Write a JavaScript program to check whether a string starts with 'Java' and
false otherwise.
4. Write a JavaScript program to compute the sum of all digits that occur in a
given string.
5. Write a JavaScript program to find the number of elements which presents
in both of the given arrays.
6. Write a JavaScript program to replace the first digit in a string (should
contains at least digit) with $ character.
7. Write a JavaScript program to find the number of trailing zeros in the
decimal representation of the factorial of a given number.
8. Write a JavaScript program to find the kth greatest element of a given
array of integers
9. Write a JavaScript program to reverse a given string.
10. Write a JavaScript program to calculate the factorial of a number.
11. Write a JavaScript program to compute the greatest common divisor
(GCD) of two positive integers.
12. Write a JavaScript program to construct the following pattern, using a
nested for loop.
13. Write a JavaScript conditional statement to sort three numbers. Display an
alert box to show the result.
JavaScript validation without RE
1. Write a JavaScript function to validate whether a given value type is
boolean or not.
2. Write a JavaScript function to validate whether a given value is RegExp or
not.
3. Write a JavaScript function to validate whether a given value type is char
or not.
4. Write a JavaScript function to validate whether a given value type is null or
not.
5. Write a JavaScript function to validate whether a given value type is NaN
or not.
JavaScript validation with RE
1. Write a JavaScript program to test the first character of a string is
uppercase or not.
2. Write a JavaScript program to check a credit card number.
3. Write a pattern that matches e-mail addresses.
4. Write a JavaScript program to count number of words in string.
5. Write a JavaScript function to count the number of vowels in a given
string.
6. Write a JavaScript function to check whether a given value is alpha
numeric or not.
7. Write a JavaScript function to check whether a given value is hexadecimal
value or not.
8. Write a JavaScript function to check a given value contains alpha, dash
and underscore.
9. Write a JavaScript function to check whether a given value is html or not.
JavaScript function
1. Write a JavaScript function that checks whether a passed string is
palindrome or not?
2. Write a JavaScript function that accepts a string as a parameter and
converts the first letter of each word of the string in upper case.
3. Write a JavaScript function that accepts a string as a parameter and find
the longest word within the string.
4. Write a JavaScript function to get the number of occurrences of each letter
in specified string.
5. Write a JavaScript function to get the function name.
JavaScript DOM
From the given link, practice the following numbers:
Numbers: 1, 3, 5, 11, 12, 13
Link: https://www.w3resource.com/javascript-exercises/javascript-dom-exercises.php