Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

js-for-react-native-11327734

student id = 11327734

Task 1

  • file : arrayManipulation.js
  • function: processArray(numbers): This function takes an array of numbers and made use of for loops for 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

Task 2

-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.

Task 3

-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.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages