-
Sum Squares:
- Prompt: Design a function that takes a positive integer as input and calculates the sum of the squares of all positive integers up to and including the given input.
-
Invert Values:
- Prompt: Implement a function that takes an array of numbers and returns a new array with the sign of each element inverted.
-
Reversed Strings without Inbuilt Methods:
- Prompt: Write a function that takes a string as input and returns the reverse of the string without using inbuilt methods like
split
,reverse
, andjoin
.
- Prompt: Write a function that takes a string as input and returns the reverse of the string without using inbuilt methods like
-
Find Smallest Integer:
- Prompt: Create a function that takes an array of integers and returns the smallest positive integer not present in the array.
-
Counting Sheep:
- Prompt: Write a function that takes a list of boolean values representing sheep, where
true
indicates that a sheep is present. Return the total number of sheep present (true values).
- Prompt: Write a function that takes a list of boolean values representing sheep, where
-
Calculate Average:
- Prompt: Design a function that takes an array of numbers and returns the average (mean) of the numbers.
-
isPalindrome:
- Prompt: Implement a function that takes a string as input and returns
true
if the string is a palindrome, andfalse
otherwise.
- Prompt: Implement a function that takes a string as input and returns
-
Find the Middle Element:
- Prompt: Create a function that takes a list of numbers and returns the middle element. If the list has an even number of elements, return the average of the two middle elements.
-
Training on Vowel Count:
- Prompt: Write a function that takes a string as input and returns the count of vowels in the string.
-
Recursive Sum of an Array:
- Prompt: Design a recursive function that takes an array of integers and returns the sum of all the elements.
-
Find Numerically Middle Index:
- Prompt: Design a function that takes an array of numbers as input and returns the index of the element that is numerically in the middle of the array. If the array has an even number of elements, return the index of the element closest to the average of the two middle elements.
-
Are Anagrams:
- Prompt: Implement a function that takes two strings as input and determines whether they are anagrams (contain the same characters with the same frequency), ignoring spaces and capitalization.
-
Sum Diagonals:
- Prompt: Create a function that takes a square matrix (2D array) as input and returns the sum of the two main diagonals (from the top-left to the bottom-right and from the top-right to the bottom-left).
Feel free to use this modified list for your JavaScript challenges! If you have any more questions or if there's anything else I can help you with, please let me know.