This repository was archived by the owner on Sep 13, 2022. It is now read-only.
Zipcode/City Search React Lab_Edgardo/Silu#93
Open
sonyaw612 wants to merge 14 commits intoCUNYTechPrep:masterfrom
Open
Zipcode/City Search React Lab_Edgardo/Silu#93sonyaw612 wants to merge 14 commits intoCUNYTechPrep:masterfrom
sonyaw612 wants to merge 14 commits intoCUNYTechPrep:masterfrom
Conversation
City Search (React Lab Part 2)
medgardo
reviewed
Oct 11, 2021
city-search/src/App.js
Outdated
| <h3>Zip Codes for {this.state.cityName}: </h3> | ||
| {/* { console.log(this.state.zipcodes)} */} | ||
| <div> | ||
| { this.state.zipcodes.forEach((element) => { |
Member
There was a problem hiding this comment.
@sonyaw612 I didn't catch this earlier, but the issue is the .forEach() method. The forEach method always returns undefined after all processing is done. What you need here is to replace it with the .map() method which transforms the entire array into a new array based on your callback.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What type of PR is this? (check all applicable)
Description
This PR [adds/removes/fixes/replaces] this [feature/bug/etc].
Related Tickets & Documents
Mobile & Desktop Screenshots/Recordings
Added tests?
Added to documentation?
[optional] Are there any post-deployment tasks we need to perform?
[optional] What gif best describes this PR or how it makes you feel?