Javascript practice exercises with solutions pdf
1. Write a JS code to print numbers from 1 to 10Function `printNumbers()` prints numbers from 1 to 10 using for loop. Show
2. Write a JS code to print a 2D arrayFunction `printArray()` prints all the elements of a 2D array using nested for loops.
3. Write a JS code to print Even numbers in given arrayFunction `printEven()` prints all the even numbers of a 2D array using for loops and ‘%’ operator.
4. Write a JS code to delete all occurrence of element in given arrayFunction `deleteElement()` deletes all the occurrence of element from the given array.
5. Write a JS code to demonstrate Async loopFor loop consisting of setTimeout() function to print loop variable 5 times in asynchronous way.
6. Write a JS code to find the power of a number using for loopFunction numPower() to returns power of number for provided exponential value using for loop.
7. Write a JS code to print a pattern using for loopFunction printPattern() is used to print a pattern for a given range using nested for loop.
8. Write a JS code to find the no of digits in a numberFunction digitCount() to returns the number of digits in a given number using while loop.
9. Write a JS code to calculate the sum of digits in a numberFunction digitSum() to returns sum of all digits in a given number using while loop. Learn more about JavaScript built-in Math methods from developer.mozilla.org/Global_Objects/Math
10. Write a JS code to find the largest number in an arrayProgram to find the largest number in the given 1D array.
11. Write a JS code to find the number of zeros in 2D MatrixProgram to find count number for zeros in 2d matrix using nested for loops and increment operation.
12. Write a JS code to find product of two arraysFunction findProd() to generate a new array which is the product of two arrays of the same size using for loop.
13. Write a JS code to print the Fibonacci series for a given value of NThe function fibonacci() prints the Fibonacci series for the given range N using While loop.
14. Write a JS code to find N value in the Fibonacci series for a given numberThe function Findfibonacci() prints the index of number in the Fibonacci series if present or “element not present” if the number is not part of the Fibonacci series.
15. Write a JS code to count all letters in a wordProgram to find the count of all letters in a word using double for loops.
16. Write a JS code to find duplicate values in a given arrayFunction findDup() to returns all the elements that are repeated more than once in a given array.
17. Write a JS code for binary search algorithmProgram to find the index of a search element in an array using the binary search algorithm.
JavaScript Loop tutorials How can I Practise JavaScript?More videos on YouTube. Build Javascript Projects. ... . Improve Existing Projects. ... . Complete Code Challenges. ... . Join an Open Source Project. ... . Join the Coding Community. ... . Share your Javascript Learning Journey with Others. ... . Write Coding Articles and Share Knowledge.. Where can I practice JavaScript problems?Codedamn is an interactive programming platform; you will learn and build projects side by side. It offers two courses to practice and master JavaScript.
How can I improve JavaScript?Let's get started:. Keep Your Basics Clear. ... . Practice As Much As You Can. ... . Stay Up to Date. ... . Remember the Rules of Programming. ... . Apply Object-Oriented Approach. ... . Write, Test, and Get Perfect. ... . Handling Error is Important. ... . Create Different Projects.. Can I practice JavaScript on my phone?The answer is obviously yes. To write a script in native javascript, you don't any special IDE exclusively developed for writing javascript. Any of your favorite text editor will be good for writing JavaScript.
|