Jan 20, 2019 22:21:25

Coding Progress # 2: JS Promises and Requests

by @davidneuman | 255 words | 🐣 | 45💌 | 7💧

David Neuman

Current day streak: 0🐣
Total posts: 45💌
Total words: 13351 (53 pages 📄)
Broken streaks: 7💧

I spent most of the day today finishing up the Introduction to JavaScript course on Codecademy. The remaining topics include promises and requests. As a beginner, keep in mind that any of the below is subject to error. If you are an experienced developer, feel free to correct me below :)

Promises are useful tools for asynchronous programming in JS. What this means is that we can instruct a computer to continue to work on a block of code while another block is worked on simultaneously, so that "time-consuming operations don't have to bring everything else in our programs to a halt". Promises can have one of three states: pending, fulfilled, and rejected. We can then instruct code to return or do something specific depending on the state. Often this involves using certain operators (i.e. await) to wait until a block of code has gone from pending to either fulfilled or rejected before returning a desired outcome.

Requests, or HTTP requests, essentially involve the client side (local) requesting information from a server. When users "submit" information on websites, they are filling out requests. Much of the syntax used in these exercises is foreign to me - it was somewhat difficult to fully grasp all of what was going on. While I do understand the basic idea, I am looking forward to creating my own requests with code to pull data from the server-side.

After this course, I will begin the modules assigned in preparation of the web developer bootcamp I will take part in this coming March.

  • 1


    Your knowledge seems right :)
    If you would like to know more about why use promises and async/await, Google "callback hell"


    Jason avatar Jason | Jan 21, 2019 08:09:14
    • 1

      @jasontxf Haha that term was actually used in the lessons! Sounds like a disaster situation...Thanks for the validation, Jason!

      David Neuman avatar David Neuman | Jan 21, 2019 15:17:54
    • 1


      Yeah, it is! been there done that haha You are welcome!! Keep on going!!

      Jason avatar Jason | Jan 21, 2019 16:31:50
  • 1

    @davidneuman aspiring developer here too. learned something new today. thanks for sharing this!

    Jason Leow avatar Jason Leow | Jan 21, 2019 13:49:19
    • 1

      @jasonleow My pleasure, glad you learned something!

      David Neuman avatar David Neuman | Jan 21, 2019 15:18:13
contact: email - twitter - facebook