This repository contains solutions for DCIT 202's assignments.
- Description: In this task we were instructed to write a function called processArray.
- File(s): [arryManipulation.js]
- Usage: With the procesArray function it takes in an array of integers as an argument. Later the .map() function is used to create a new array based on certain condition.
- When the number in the array is an even number it multiplies it by two and when it is odd it multiplies by 3
- Description: In task2 we were require to add a function formatArrayStrings in arrayManipulation .js
- File(s): [arrayManipulation.js]
- Usage: with the formatArrayStrings it takes an array of strings and and the output of the processedArray as an argument it returns the stringArray with the .map() method acting on it.
- The .map() method takes in an argument of elements and inddex
- Description: This task involves creating user profiles from a list of names. Each profile will include an ID, the original name, and a modified name. The ID is a sequential number starting from 1. The modification of names is done using helper functions
processArray
andformatArrayStrings
imported from thearrayManipulation
module. - File(s): This task is implemented in a file named
userProfileCreation.js
. - Usage: The
createUserProfiles
function can be used to generate an array of user profile objects from an array of names. Below are the instructions on how to use the implementation.
Example const names = ["Alice", "Bob", "Charlie"]; const profiles = createUserProfiles(names); console.log(profiles);
Link to repository [https://github.com/frankmawuli/js-for-react-native-11232324.git].