[Go to site: main page, start]

0% found this document useful (0 votes)
12 views2 pages

JavaScript Exercise

The document outlines a series of JavaScript exercises focusing on various programming concepts, including basic functions, object manipulation, and algorithm implementation. It also includes HTML and CSS tasks for form validation, creating an image gallery, a todo list application, and a calculator. Each exercise aims to enhance skills in JavaScript, HTML, and CSS through practical applications and interactivity.

Uploaded by

tekaleadesh67
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)
12 views2 pages

JavaScript Exercise

The document outlines a series of JavaScript exercises focusing on various programming concepts, including basic functions, object manipulation, and algorithm implementation. It also includes HTML and CSS tasks for form validation, creating an image gallery, a todo list application, and a calculator. Each exercise aims to enhance skills in JavaScript, HTML, and CSS through practical applications and interactivity.

Uploaded by

tekaleadesh67
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

JavaScript Exercise

❖ Basics
1. Sum of Two Numbers Write a function that takes two numbers as arguments and returns their sum.
2. Reverse a String Write a function that reverses a string (e.g., "hello" becomes "olleh").
3. Factorial Calculation Write a function that computes the factorial of a given number.
4. Check for Palindrome Write a function that checks if a given string is a palindrome.
5. Fibonacci Sequence Write a function to generate the nth Fibonacci number.
6. Unique Elements in Array Write a function to find all unique elements in an array.
7. Merge Sorted Arrays Write a function that merges two sorted arrays into a single sorted array.
8. Validate Email Address Write a function that validates if a given string is a valid email address.
9. Sort Array of Objects Write a function to sort an array of objects by a specified key.
10. Binary Search Implement a binary search algorithm to find an element in a sorted array.
11. Longest Substring Without Repeating Characters Write a function that finds the length of the
longest substring without repeating characters.
12. Implement Promise Implement a simplified version of the Promise object in JavaScript.
13. Implement LRU Cache Implement an LRU (Least Recently Used) cache using JavaScript classes.
14. Graph Traversal Implement algorithms for graph traversal (BFS or DFS) in JavaScript.
15. Matrix Operations Write functions for matrix addition, multiplication, and transpose.
16. WAP to display following format on from using css and do the arithmetic operations.
a. Enter First No
b. Enter Second No
c. Addition Subtraction
d. Multiplication Division
e. Result

17. WAP to display the message when first button is clicked ,as first
a. button is selected and when second button is clicked, it will
b. display the message that second button is [Link] css for style.
c. Button1
d. Button2

18. Write a JavaScript program to compute the sum of the two given integers. If the two values are same,
then returns triple their sum.
19. Write a JavaScript program to create a new string adding "Py" in front of a given string. If the given
string begins with "Py" then return the original string.
20. Write a JavaScript program to create a new string from a given string with the first character of the
given string added at the front and back
21. Write a JavaScript program to reverse the elements of a given array of integers length 3
22. Write a javaScript program to replace uppercase letters to lowercase and vice versa
23. Write a JavaScript program to find the maximal difference between any two adjacent elements of a
given array of integers.
24. Print todays Date,Date after 5 dyas in different Format.
25. Generate OPT using simple Function.(hint: use Math Object)
26. Create Object Person1 having properties Name, ContactNo, Address & Display function to display
details.
27. Create Object Person2 having properties Name, ContactNo, Address. Use Display Fun of Person1
Object to display details. [hint: use Call,Apply & Bind].
28. Design Employee class having members E_Id, Name, Desgnation. Write Parameterized constructor
to accept values, Show [Link] 3 Employees & Display Details.
29. Add properties Salary,bonus & dissal() function using Prototype propery.
30. Create class Manager which extends Employee having additional properties incentive & totalsal()
function which displays a salary+incentive as total salary.

HTML + CSS +JS


• Form Validation:

• Create an HTML form with fields for name, email, and password.
• Apply CSS to style the form elements (e.g., borders, colors, fonts).
• Use JavaScript to validate the form before submission (e.g., ensure fields are not empty, validate
email format, check password strength).

• Image Gallery with Modal:

• Create an image gallery using HTML and CSS (grid layout, thumbnails).
• Apply CSS for hover effects on images (e.g., zoom effect, border change).
• Use JavaScript to implement a modal (popup) that displays a larger version of the image when
clicked.

• Todo List Application:

• Design an HTML structure for a todo list (input field, add button, list items).
• Style the todo list using CSS (list styles, colors for different states).
• Implement JavaScript functionalities:
o Add new items to the list dynamically.
o Mark items as completed with a strikethrough effect.
o Delete items from the list.

• Interactive Dropdown Menu:

• Create an HTML dropdown menu using <select> and <option> elements.


• Style the dropdown menu using CSS (custom styling for options, hover effects).
• Use JavaScript to add interactivity:
o Display different content or perform actions based on the selected option.

• Interactive Image Map:

• Use HTML <img> and <map> elements to create an image map with clickable areas.
• Apply CSS to style the image map areas (change colors on hover).
• Implement JavaScript to handle click events on the image map areas (e.g., show tooltips, navigate to
different pages).

• Calculator Application:

• Design an HTML layout for a calculator (buttons for digits, operators, clear, equals).
• Apply CSS to style the calculator layout (button colors, borders, layout design).
• Use JavaScript to implement calculator functionalities:
o Perform basic arithmetic operations (addition, subtraction, multiplication, division).
o Display results dynamically as users click buttons.

Note:-Try all css exercise with js too.

You might also like