Problem Solving with JavaScript
Problem-solving is the demonstration of characterizing a problem; deciding the reason for the problem; distinguishing, organizing, and choosing options for an answer; and actualizing an answer.
Now I start solving problems using JavaScript. I will start from simple to troublesome. It will be lots of fun and can enable you to conceptualize.
1. Find the largest element of an array
We can find the largest number in an array using Math.max() function. The Math.max() returns the largest number given as input parameters.
2. Sum of all numbers in an array
We can sum all the numbers in an array using reduce() function.
3. Remove duplicate item from an array
4. Count the number of words in a string
5. Reverse a string
6. Calculate Factorial of a number using for loop
7. Calculate Factorial of a number using a while loop
8. Calculate Factorial in a Recursive function
9. Create a Fibonacci Series using a for loop
10. Fibonacci Element in a Recursive Way
11. Create a Fibonacci series in a recursive way
12. Check whether a number is a Prime Number or not
That’s all for today. Thank You.