0% found this document useful (0 votes)
31 views

Js Assignment

JavaScript assignment ques

Uploaded by

bhavyaw267
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
31 views

Js Assignment

JavaScript assignment ques

Uploaded by

bhavyaw267
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

1.

Write a JavaScript program to determine whether a given year is a leap year


2. Write a JavaScript program to convert temperatures to and from Celsius, Fahrenheit.
[ Formula : c/5 = (f-32)/9 [ where c = temperature in Celsius and f = temperature in
Fahrenheit ]
Expected Output :
60°C is 140 °F
3. Write a JavaScript program to remove a character at the specified position in a given string
and return the modified string.
4. Write a JavaScript program to create another string from a given string with the first
character of the given string added to the front and back.
5. Write a JavaScript program to check whether a given positive number is a multiple of 3 or 7.
6. Write a JavaScript program to check whether a string starts with 'Java' if it does not
otherwise.
7. Write a JavaScript program to find the largest of three given integers.
8. Write a JavaScript program to reverse a given string.
9. Write a JavaScript program to replace every character in a given string with the character
following it in the alphabet.
10. Write a JavaScript program to capitalize the first letter of each word in a given string.
11. Write a JavaScript program to concatenate two strings
12. Write a JavaScript program to reverse the elements of a given array of integers
13. Write a JavaScript program to add two positive integers
14. Write a JavaScript program to change the capitalization of all letters in a given string
15. Write a JavaScript program to remove all characters from a given string that appear more
than once
16. Write a simple JavaScript program to join all elements of the following array into a string.
Sample array : myColor = ["Red", "Green", "White", "Black"];
Expected Output :
"Red,Green,White,Black"
"Red,Green,White,Black"
"Red+Green+White+Black"
17. Write a JavaScript program to sort the items of an array.
Sample array : var arr1 = [ -3, 8, 7, 6, 5, -4, 3, 2, 1 ];
Sample Output : -4,-3,1,2,3,5,6,7,8
18. Write a JavaScript program to find the most frequent item in an array.
Sample array : var arr1=[3, 'a', 'a', 'a', 2, 3, 'a', 3, 'a', 2, 4, 9, 3];
Sample Output : a ( 5 times )
19. Write a javascript program to remove a character at specified position of a given string and
return the new string.
20. Write the javascript program to find the area of triangle.
21. Write a javascript program to determine whether a given year is Leap year or not
22. Write a javascript program to calculate multiplication and division of two numbers
23. Write a javascript program to convert temperature to Celsius to Fahrenheit
24. Write a javascript program to check whether a given number is a multiple of 7
25. Write a javascript program to change the case of a given string (uppercase to lower case and
vice versa
26. Write all the string methods with output
27. Write all the array methods with their output

You might also like