JS Programs

JS Programs

·

2 min read

  1. Swap 2 integers present in variables num1 and num2 without using temporary variable
  2. Write a function which returns true if given value of number is an integer without using any inbuilt functions
  3. Create a function which returns a random number in the given range of values both inclusive
  4. Write a program to reverse a string
  5. Write a program to reverse a string by words. Also show the reverse of each words in place
  6. Write a program to reverse a given integer number
  7. Write a code to replace all the spaces of the string with underscores
  8. Write a function which can convert the time input given in 12 hours format to 24 hours format
  9. Write a function which accepts a string argument and returns the count of characters between the first and last character 'X'
  10. Write a code to truncate a string to a certain number of words
  11. Create a regular expression to validate if the given input is valid Indian mobile number or not
  12. Write a function which returns a list of elements which contains at least one character as digit
  13. Write a function which checks if a given search text is present either in the beginning of the first name or the second name
  14. Write a function to chop a string into chunks of a given length and return it as array
  15. Write a code to remove all the vowels from a given string
  16. Create a function which returns random hex color code
  17. Write a function which accepts two valid dates and returns the difference between them as number of days

Screenshot 2022-01-08 at 9.46.33 PM.png

Screenshot 2022-01-08 at 10.12.31 PM.png

Screenshot 2022-01-08 at 10.19.59 PM.png

Screenshot 2022-01-08 at 10.23.44 PM.png

Screenshot 2022-01-08 at 10.46.19 PM.png

Screenshot 2022-01-08 at 10.51.09 PM.png

Screenshot 2022-01-08 at 10.54.07 PM.png

Screenshot 2022-01-09 at 12.10.01 PM.png

Screenshot 2022-01-09 at 10.00.07 PM.png

Screenshot 2022-01-09 at 9.32.34 PM.png

Screenshot 2022-01-09 at 10.18.57 PM.png

Screenshot 2022-01-09 at 10.36.57 PM.png