0% found this document useful (0 votes)
3 views1 page

JavaScript Function Challenges: Moderate Level

The document contains a list of moderate-level JavaScript function challenges. Each challenge requires the implementation of a specific function, such as checking for palindromes, counting character occurrences, and flattening nested arrays. The tasks also include string manipulations and mathematical computations like calculating factorials.

Uploaded by

Rahul Burdak
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)
3 views1 page

JavaScript Function Challenges: Moderate Level

The document contains a list of moderate-level JavaScript function challenges. Each challenge requires the implementation of a specific function, such as checking for palindromes, counting character occurrences, and flattening nested arrays. The tasks also include string manipulations and mathematical computations like calculating factorials.

Uploaded by

Rahul Burdak
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 Function Questions (Moderate Level)

1. Write a function to check if a given string is a palindrome (same forwards and backwards).

2. Create a function that accepts an array and returns a new array with only the unique values.

3. Write a function that counts how many times a specific character appears in a string.

4. Write a function that accepts a number and returns the factorial of that number using recursion.

5. Create a function that finds the second highest number in an array.

6. Write a function that flattens a nested array (e.g., [1, [2, [3, 4]], 5] => [1, 2, 3, 4, 5]).

7. Create a function that accepts a date string and returns the day of the week.

8. Write a function that checks if two strings are anagrams of each other.

9. Create a function that capitalizes the first letter of each word in a sentence.

10. Write a function to reverse the words in a sentence but not the characters (e.g., 'Hello World' =>

'World Hello').

You might also like