Class 6

Ryan Pearson
1 min readSep 12, 2021
  • If a user attempts to create a resource that already exists — for example, an email address that’s already registered — what HTTP status code would you return?

403 forbidden — can be used when creating a duplicate record when only one is allowed

  • Consider a responsive site design that requires a full-width image in all responsive states. What would be the correct way to code this to ensure the page loads the smallest image required to fill the space?

By using the attributes srcset and sizes, these allow the browser to select the correct image based on the size of the screen

  • When should you npm and when should you yarn?

They are very similar, npm is more widely used, but yarn has quicker installation times.

  • How can you make sure your dependencies are safe?

Automate the update/security audits.

  • What are the differences between CHAR and VARCHAR data types (MySQL)?

CHAR- fixed length, VARCHAR- variable length

  • How else can the JavaScript code below be written using Node.Js to produce the same output?

--

--