AuthorSchema = { blogposts: BlogPost[] }
✔ Pros:
- Easy to query for all/specific authors.
- Easy to update an author or delete him (including his blogposts) with a single command.
1) So you said that the API should not use a database and at the same time it should allow you to register users. | |
The only possible way is storing users in the memory, but restarting the server will reset the integers. is that ok? | |
2) Do the numbers have to be exact sequential (one exactly after another)? | |
for example if current integer is "5", if the user call "next integer" endpoint, it will return you "7" or "10" any integer larger than current one. is that ok? | |
3) Can the integers be large like "1590081234" ? Actually I have the idea of using timestamps 😅. | |
4) Should the integers be unique accross users also ? I mean can 2 users or more, share the same integer? |
let arr = []; | |
arr.maxLength = 3; | |
Array.prototype.pushLimited = function(elem) { | |
if (this.length === this.maxLength) { | |
throw new Error('max length exceeded'); | |
} else { | |
this.push(elem); | |
} | |
} |
Bicycle World | |
Welcome to Bicycle World, the premier text-based bicycle shop! This shop is only accessible to programmers like you, who are familiar with the command line. | |
In this project, I used the commands I learned to navigate and edit the filesystem. | |
The filesystem is shown below. Main directory is BicycleWorld. | |
BicycleWorld | |
|—— brands.txt | |
|—— freight/ |
Promise
?await
?Louis[n] went[v] to the store[n], and it was fun[a]. He taught[v] the class[n]. |
The objective of this discussion is to expose you to some of the popular frameworks that are built on top of JavaScript or React. The goal is not for you to know how to use these, but simply understand what their intended usage is in case you want to use it at some point in time.
For each of these, I want you to answer the following questions for the class: