- file : arrayManipulation.js
- function: processArray(numbers): This function takes an array of numbers and made use of
for loopsfor iteration. - The loop checks if the respective numbers in the array are even or odd using the modulo operator.
- If the number is even, it returns the square of that number
- If the number is odd, it returns the cube of that number
-file : arrayManipulation.js
-function : formatArrayStrings(strings, mynumbers): This fumction takes an array of numbers(from the processArray function) and an array of strings and makes use of for loops.
- If the number in the mynumbers array is even, the function capitalizes the corresponding string in the array of strings.
- If the number in the mynumbers array is odd, the function makes the corresponding string in the array of strings lower case.
-file : userInfo.js.js
-function : createUserProfiles(names, modifiedNames): This function takes two arrays as input: an array of original names and an array of modified names (processed by the formatArrayStrings function). and makes use of for loops.
originalName: The original name from the names array.
modifiedName: The modified name from the modifiedNames array.
id: An auto-incremented ID (starting from 1) to uniquely identify each user.
The function pushes each created user profile object into a new array and returns this array.