Skip to content

finished project#221

Open
cjedrasik03 wants to merge 1 commit into
projectshft:masterfrom
cjedrasik03:master
Open

finished project#221
cjedrasik03 wants to merge 1 commit into
projectshft:masterfrom
cjedrasik03:master

Conversation

@cjedrasik03
Copy link
Copy Markdown

No description provided.

Comment thread main.js
.then(response => response.json())
.then(data => {
return {
Lat: data[0].lat,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if data comes in a different format your app will crash.
Always be safe, check if its array and if so, then try to access it. Also you need to catch the errors.

Comment thread main.js
.then(response => response.json())
.then(data => {
return {
Lat: data[0].lat,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why with capital? use lowercase

Comment thread main.js

fetchCordinates(userInput)
.then(cordinates => {
getCurrWeather(cordinates);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you are calling this getCurrentWeather but this function returns nothing. Better calling it fetchWeather. Also you are displaying the weather inside of this function. This is confusing and prone to bugs. Be clear with what the functions are doing

Comment thread main.js
fetch(url, { method: 'GET' })
.then(response => response.json())
.then(data => {
let weatherData = {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you are not reassigning this, should be const

Comment thread index.html
>
<h4><strong></strong></h4>
<div class="py-3 weather-info">
<h3><strong></strong></h6>
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wrong closing tag

Comment thread index.html
>
<h4><strong></strong></h4>
<div class="py-3 weather-info">
<h3><strong></strong></h6>
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants