39
Wombat
7y

Understood Javascript callbacks today.

... uhh that feels good.

Comments
  • 3
    Are you that about sure? ;)
  • 4
    Wait till you get to promises
  • 2
    @Paralax thanks for making me feel unsafe again. :D

    So, what else there is to know about callbacks?
  • 1
    @floatright If I understand the promises right I don't have to use them if I fine with simple callbacks, is that right?
  • 3
    Wait till your projects gets big, you'll spend half the time in understanding the source of callback function of callback function of callback function of.......

    Hint - use promises ;)
  • 8
    You never understand Javascript. That's how it works.
  • 3
    @Divisionbyzero Well, not really. Promises are a different use case. In fact promises themselves can accept callbacks. Anyway, if you are using jquery for network requests, you're already using callbacks in promises ;)
  • 1
    @floatright well i do. So I will read myself into this.
  • 1
    @floatright @Divisionbyzero and after you get promises start with async await :)
  • 1
    @vzqzac I had never heard of it before. Thanks for bringing it to my notice! Will keep a lookout for this feature
  • 1
    XMLHttpRequests aren't promised by default. It's just event based. Libraries exist to wrap then and use promises though.
  • 1
    @floatright here you go dude :) new approaches on ECMA are really cool
    https://developer.mozilla.org/en-US...
  • 1
    @vzqzac nice, but the browsers seems to support this poorly.
  • 1
    @Divisionbyzero yes, this does actually come with ES.. 7 I guess? So it will take its time to be available everywhere, but node LTS supports it now and as a developer more​ focused in back end I'm really excited :D
  • 0
    Oh. I somehow missed the part where you were talking about jQuery based queries.
Add Comment