Solving Problems Using Array Functions In React