hyf-homework's People
hyf-homework's Issues
Homework Feedback JS2 Week 3
Looks good, but if you couldn't get your game to run, then you're very welcome to ask for more help in the channel. Pay attention to some of the following:
It's better to keep the return
type of the function consistent, will lead to fewer errors when you handle the results.
Better to use setTimeout
here if you only want it to run once.
Use strict equality operator(===
) for these comparisons, or in general as much as possible.
Please don't name variables starting with a capital letter, just a matter of convention. It's kept for static
methods and class
names.
Homework Feedback - React Week 4
Good work!
Homework Feedback - Node Week 1
Circle Class
Good job on the Circle
class. Nicely done with proper documentation.
Meal Sharing Website
1. Unnecessary fs
module in package.json
The fs
module that you use in your homework in
file system
module in Node
which does not need to be installed as a separate package in your package.json
. You can read more about the fs
module in Node documentation here: https://nodejs.org/api/fs.html
The package with the same name that you have installed here
is an empty placeholder package. You can safely remove it from your homework using npm uninstall fs
.
2. Inconsistencies in files in data directory
In the meals.json
file, the price of the first item is of the type number
but all other prices are string
values. Also, except for the first item, the createdAt
property for all objects displays a SyntaxError
instead of a useful value.
In the reservations.json
file, all the email strings have spaces which would render them invalid.
Although these are not causing any problems in your homework, it's good to review the data that you use.
3. Implementation of Route /meal
The requirements for this route were to Respond with the json for a random meal. If the meal has a reservation that matches its id, then add the email of that reservation to the json
.
Although there's nothing wrong per se with the way you have implemented it, perhaps there's a more compact way to presenting this data. In case of meals for which multiple reservations are available, when one of them is selected as a random meal, the result in the browser looks like multiple meal objects are being sent, even though it's the same meal in each object and the only different property is the reservation email. Instead of creating multiple meal objects for each matching reservation, if all the matching reservations or the associated emails are stored as an array in a separate property on the meal object, it would probably be easier for the user to interpret the data. An example of this implementation would be something like this:
{
"id": 10,
"title": "kabab",
"maxNumberOfGuests": 19,
"description": "Amet ut voluptate ex consectetur proident. Magna proident eiusmod laborum do cupidatat dolor quis in quis in mollit esse officia. Qui aliqua pariatur laborum laborum non ut amet est eiusmod pariatur nulla ipsum dolore sint. Aliquip ullamco do mollit exercitation deserunt aliquip excepteur exercitation anim ex anim elit proident. Exercitation aliquip consectetur eiusmod ipsum id est dolore eu commodo occaecat ad excepteur id.",
"createdAt": "<SyntaxError: Unexpected identifier>",
"price": "100.67",
"mealReservations": [
{
"name": "Barry Whitaker",
"email": "barry [email protected]",
"mealId": 10
},
{
"name": "Cooke Hancock",
"email": "cooke [email protected]",
"mealId": 10
},
{
"name": "Everett Christensen",
"email": "everett [email protected]",
"mealId": 10
},
{
"name": "Lowe Albert",
"email": "lowe [email protected]",
"mealId": 10
}
]
}
If you have a different viewpoint about it, please let me know.
Conclusion
Overall, very impressive work. Keep it up!!
Homework Feedback - Node Week 3
Calculator Exercise
Nice work on implementing the calculator. However, there's a bug here. One of the requirements was to account for situations where the same query parameter is used multiple times, e.g. calculator/multiply?firstParam=1&secondParam=2&secondParam=4
The way you have implemented it, such queries return NaN
instead of the solution due to the fact that all the values with the same query parameter (secondParam in this case) are aggregated in an array and a Number
conversion operation on each query parameter without first checking whether it's a String
or something else leads to this problem.
Meal Sharing Website
Please let me know if you found it difficult to implement this part of the homework or just couldn't make time for it.
Homework Feedback - React Week 3
Very impressive work. However, you were required to use props.children within your homework for the week which I do not see in any of the components you have created on your own.
Overall, very well done. Keep it up!
Homework Feedback - React Week 1
Really good work. Keep it up!
Homework Feedback - React Week 2
Very well done. Keep it up!
Homework feedback Node.js week 2
Works well. Slight issue with routing pointed out, which is a best practice, so I would like you to implement.
You can also change main
parameter here to indicate your startup file and not have to repeat it in the commands to follow.
You should use app.use
at this level so that the router can decide if it wants to accept GET/PUT/POST
etc.
This is unnecessary if you are already assigning the whole resource to the router.
If you would've done app.use
in your main file, then you could just define relative urls here.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.