JAVASCRIT INTERVIEW QUESTIONS
1. Write a JavaScript function that reverse a number
2. Write a JavaScript function that checks whether a passed string is
palindrome or not?
3. Write a JavaScript function to test whether a date is a weekend.
4. Write a JavaScript function to get the maximum date from an array of
dates.
5. Write a JavaScript function to count the number of days passed since
beginning of the year.
6. Write a JavaScript program to calculate age
7. Write a JavaScript function to get ISO-8601 numeric representation of
the day of the week (1 (for Monday) to 7 (for Sunday))
8. Write a JavaScript function to get a two digit representation of a year
9. Write a JavaScript function to add specified months to a date
10. Write a JavaScript function to find whether or not the date is in
daylights savings time
11. Write a JavaScript function to get the first element of an array.
Passing a parameter 'n' will return the first 'n' elements of the array.
12. Write a simple JavaScript program to join all elements of the
following array into a string
13. Write a JavaScript program to sort the items of an array.
14.
15. Write a JavaScript program to copy a string to the
clipboard
16. Write a JavaScript function to get the current date
17. Write a JavaScript program to set the background color of a
paragraph
18. Write a JavaScript program to remove items from a dropdown
list
19. Write a JavaScript program to highlight the bold words of the
following paragraph, on mouse over a certain link
20. Write a JavaScript program to display a random image (clicking
on a button).
21. Write a JavaScript program to get the length of an JavaScript
object
22. Find the leap years in a given range of years
23. Write a JavaScript function to merge two arrays and removes all
duplicates elements
24. Wrte a JavaScript function to parse an URL
25. Write a JavaScript function to check whether a given
value is a DOM element.
26. Write a JavaScript function to retrieve all the values of an
object's properties.
27. Write a JavaScript program to compute the sum and product of
an array of integers
28. Write a JavaScript program to add items in an blank array and
display the items
29. Write a JavaScript function to get the number of days in a
month.
30. Write a JavaScript function to compare dates (i.e. greater than,
less than or equal to).
31. Write a JavaScript function that returns a passed string with letters in
alphabetical order.
32. Write a JavaScript program that accept two integers and display the
larger
33. Write a JavaScript for loop that will iterate from 0 to 15. For
each iteration, it will check if the current number is odd or even, and
display a message to the screen.
34. Write a JavaScript program to find all distinct prime
factors of a given integer.
35. Write a JavaScript program to swap two halves of a given
array of integers of even length
36. Write a JavaScript program that will return true if the
browser tab of the page is focused, false otherwise.
37. Write a JavaScript function to get 24-hour format of an hour
without leading zeros
38. Write a JavaScript function to check whether an `input` is a
string or not
39. Write a JavaScript function to split a string and convert it into
an array of words
40. Write a JavaScript function to capitalize the first letter of each
word in a string
41. Write a JavaScript function to concatenates a given string n
times (default is 1)
42. Write a JavaScript function to truncate a string to a certain
number of words.
43. Write a JavaScript function to remove non-word characters.
44. Write a JavaScript function to get the values of First and Last
name.
45. Write a JavaScript program to get a random integer in the
specified range
46. Write a JavaScript program to add special characters to
text to print in color in the console (combined with
console.log()).
47. Write a JavaScript program to add an event listener to an
element with the ability to use event delegation
48. Write a Bubble Sort algorithm in JavaScript.
49. Write a JavaScript program which returns a subset of a string.
50. Write a JavaScript program to create a Clock
51. Write a JavaScript program to check if a given matrix is
lower triangular or not