HARDEST JavaScript Interview Question Ever! Part 1

แชร์
ฝัง
  • เผยแพร่เมื่อ 7 ก.ค. 2020
  • Want to know when Advanced JavaScript Course releases exclusively on codedamn.com? Sign up on codedamn.com for free and I'll let you know with an email ;)
    ------------
    Don't forget to subscribe and like the video if you enjoyed :)
    Be a damner, join the coding community: codedamn.com

ความคิดเห็น • 82

  • @mosaddikalimaruf2722
    @mosaddikalimaruf2722 2 ปีที่แล้ว +25

    The Most Underrated Video I've ever seen. Dude, this video should be the best suggestion for understanding the event-loop of JS.

  • @nacimhoc
    @nacimhoc 2 ปีที่แล้ว +1

    Great one! that let you really understand how the call stack works, thanx for your work.

  • @kirillpavlovskii8342
    @kirillpavlovskii8342 3 ปีที่แล้ว

    Great explained! Thanks so much !

  • @BharatSingh-zk8lx
    @BharatSingh-zk8lx 2 ปีที่แล้ว

    WOO HOOO got it right at first haha even though I have never focused on advanced concepts, tutorial was very informative, now I know how it works, thankss a lot

  • @KamalNayak
    @KamalNayak 2 ปีที่แล้ว

    One of the Best explanation for event loop and the BGM is awesome

  • @matheusfelizardo9155
    @matheusfelizardo9155 2 ปีที่แล้ว

    Very nice explanation.
    Thank you very much!!

  • @amirabbasIT
    @amirabbasIT 3 ปีที่แล้ว +1

    Loved it well explained!!!!

  • @basemm6829
    @basemm6829 2 ปีที่แล้ว +1

    Is there a part 2 for this video?
    Great one BTW

  • @rangakomarthi9905
    @rangakomarthi9905 2 ปีที่แล้ว

    Very nice explanation bro :)

  • @Youraverageprogrammer
    @Youraverageprogrammer 2 ปีที่แล้ว

    Excellent explanation!

  • @shanthoshkumarr6711
    @shanthoshkumarr6711 ปีที่แล้ว

    Great ...u deserve more 🙏🙏

  • @skumarburnwal
    @skumarburnwal 2 ปีที่แล้ว

    wow that was an awesome explanation.

  • @a_basic_beach
    @a_basic_beach 3 ปีที่แล้ว +6

    This was a cool lesson, but I wrote down how it would go before watching the video and it's pretty simple if you understand how setTimeout works/event queue in javascript. Really good book helping me out was secrets of the javascript ninja 2nd edition, recommend it for anyone with some javascript experience.

    • @codedamn
      @codedamn  3 ปีที่แล้ว +2

      Cool, thanks!

  • @alizaidi5610
    @alizaidi5610 3 ปีที่แล้ว +1

    great video great music too

  • @russelldriver6394
    @russelldriver6394 3 หลายเดือนก่อน

    That was spectacular

  • @asagiai4965
    @asagiai4965 5 หลายเดือนก่อน

    Really nice explanation

  • @tadiwamahlunge2214
    @tadiwamahlunge2214 ปีที่แล้ว

    Thi was wonderful brother

  • @abhisheksaxena6413
    @abhisheksaxena6413 2 ปีที่แล้ว

    The video was very insightfull ... background sound reminded me of movie Fight Club

  • @prasadbobbili471
    @prasadbobbili471 4 ปีที่แล้ว

    Excellent!

  • @Hari-mr1st
    @Hari-mr1st 2 ปีที่แล้ว

    This is gold.

  • @omairnabiel9516
    @omairnabiel9516 4 ปีที่แล้ว +2

    That was good!

  • @shrrayangoel1014
    @shrrayangoel1014 ปีที่แล้ว +1

    THis is so good man..epic shit

  • @nasarshaik5207
    @nasarshaik5207 2 ปีที่แล้ว

    thank you sir, nice video

  • @jatinchourasia9977
    @jatinchourasia9977 2 ปีที่แล้ว

    background music suites best for the question 😂 😂 😂 😂

  • @deepakvishwakarma2043
    @deepakvishwakarma2043 2 ปีที่แล้ว

    Scary sci-fi alien music

  • @maddy5996
    @maddy5996 2 ปีที่แล้ว +3

    I knew it from started, btw i have taken jonas schmedtmann course from udemy and other online sources, am so happy that i knew the answer

    • @alexluu3615
      @alexluu3615 2 ปีที่แล้ว

      Jonas's course was amazing, in my opinion as a new programmer

  • @informatiquedz9800
    @informatiquedz9800 2 ปีที่แล้ว

    great video, there is no part 2 i think

  • @Omg_facts_ai
    @Omg_facts_ai 2 ปีที่แล้ว +1

    great explanation! , the core idea was when the call stack is empty and something is in microstask it will pick the microtask as it has higher priority than task queue even if synchronous function is waiting to be executed. Correct me if Iam wrong

    • @navinkumarsahu1159
      @navinkumarsahu1159 7 หลายเดือนก่อน

      no after all synchronous code finished execution then only microtask and task gets executed

  • @harshilparmar9076
    @harshilparmar9076 ปีที่แล้ว

    10:23 is the most important thing is event loop will finish all microtaskqueue in one go whereas after each taskqueue execution it will re-run whole cycle again.First it was confusing to me show I am writing it here correct me if I am wrong. Thanks Mehul bhai.

  • @vishal_sharma_rha
    @vishal_sharma_rha 2 ปีที่แล้ว

    Thank you Mehul 🙏

  • @sanchit5764
    @sanchit5764 ปีที่แล้ว

    HARDEST part about this video was the explanation, which I ended up skipping. If you're the same,JUST RELAX YOU'RE DOING GOOD

  • @RameezKhalil-pn4yo
    @RameezKhalil-pn4yo ปีที่แล้ว

    Awesome!!!

  • @rohityv_
    @rohityv_ 2 ปีที่แล้ว

    Thank you bhai!

  • @harshilparmar9076
    @harshilparmar9076 4 ปีที่แล้ว

    Perfect !!!

  • @themadextreme
    @themadextreme 3 ปีที่แล้ว

    Awesome 👏

  • @lahmerilyas4430
    @lahmerilyas4430 2 ปีที่แล้ว

    You are my hero

  • @marimuthuselvaraj2646
    @marimuthuselvaraj2646 4 ปีที่แล้ว

    That's very good

  • @yaswanthravuri8450
    @yaswanthravuri8450 2 ปีที่แล้ว

    Thanks bro

  • @RushabhWadkar
    @RushabhWadkar 3 ปีที่แล้ว

    Where is part #2?

  • @sj9851
    @sj9851 3 ปีที่แล้ว +2

    My browser prints different order than video shows at 3:58, why is that?
    #1 main thread
    #2 main thread
    #1 promise 1
    #2 promise 1
    #1 timeout 1
    #1 timeout 2
    #1 promise 2
    #2 timeout 1
    #2 timeout 2
    #2 promise 2

    • @venkateshng2010
      @venkateshng2010 2 ปีที่แล้ว

      which browser do you use? I predicted what you have mentioned here, and was surprised to see a different output

    • @charithagoonewardena3095
      @charithagoonewardena3095 2 ปีที่แล้ว

      You are right. This is the correct output. He’s explanation is sketchy for me.

  • @cenacr007
    @cenacr007 ปีที่แล้ว

    where is part 2 of this video ????

  • @Tiberiumgod
    @Tiberiumgod 2 ปีที่แล้ว

    Where is part 2?

  • @expertreviews1112
    @expertreviews1112 2 ปีที่แล้ว

    Where do you learn this stuff?

  • @dhanmoninath834
    @dhanmoninath834 2 ปีที่แล้ว

    Yay I got it correct!!!

  • @abhinaygupta4052
    @abhinaygupta4052 9 หลายเดือนก่อน

    Bhai like to Banta hai tuze ek

  • @sheikhatif8218
    @sheikhatif8218 2 ปีที่แล้ว

    Who puts music in tutorial videos?. and btw the output might differ on different browsers.

  • @fullstackraj
    @fullstackraj 7 หลายเดือนก่อน

    I m your Fan Bro 😅

  • @mengjunwang8687
    @mengjunwang8687 2 ปีที่แล้ว +1

    why line 6 is before line 18, can you explain that pls

    • @charithagoonewardena3095
      @charithagoonewardena3095 2 ปีที่แล้ว

      Im pretty sure 18 will print first then 6. Im not sure why this snippet printed out the 6 before 18. I checked in my browser. Promise will always print after the main thread is empty. Not the local execution context empty.

  • @ishanktyagi
    @ishanktyagi 4 ปีที่แล้ว

    Don't add the music in the next video! Btw, nice work.

    • @codedamn
      @codedamn  4 ปีที่แล้ว +1

      Sounds good! (pun). On a serious note, sure, I’ll keep that in mind

    • @diederik_pro
      @diederik_pro 4 ปีที่แล้ว +2

      @@codedamn I enjoyed it. It's different and gives a cool vibe. don't write the whole idea off ;-)

  • @dheerajnaik6467
    @dheerajnaik6467 4 ปีที่แล้ว +1

    Please dont add background music. It is really distracting .

  • @nilesh319
    @nilesh319 ปีที่แล้ว

    If we call functions like below then output is different. Can you please explain that?
    listener1();
    listener2():
    Here I am not adding event. Directly calling 2 functions one by one.

    • @anuranjansingh3460
      @anuranjansingh3460 ปีที่แล้ว

      It's because here in the video, the function are callbacks which get pushed to task queue on click event where as when you call the function directly, it gets pushed to call stack

  • @jamjam3448
    @jamjam3448 4 ปีที่แล้ว

    best explanation

  • @charithagoonewardena3095
    @charithagoonewardena3095 2 ปีที่แล้ว

    Line 18 should print before line 6. How come promise prints before main thread is empty?

    • @abdurrahman6087
      @abdurrahman6087 ปีที่แล้ว

      promise stay in microtask and callstack will execute microtask before taskqueue

    • @cenacr007
      @cenacr007 ปีที่แล้ว

      cause listener itself is a callback func so the 2 listener func first go to taskqueue and not callstack, and once listener1 executes it pushes some stuff in microtask queue which gets picked by JS before the listener2 waiting in taskqueue is picked up.

  • @Ameersoccerdev
    @Ameersoccerdev 2 ปีที่แล้ว

    Why music ....?

  • @prashantmestry8199
    @prashantmestry8199 4 ปีที่แล้ว

    I do not understand why there is need of louder irritating background music. It is not necessary, your content is good that real learner will get benefit from.

    • @codedamn
      @codedamn  4 ปีที่แล้ว +1

      I’m sorry if the music was too loud, would make sure to tune it down next time

  • @ElderESG
    @ElderESG 2 ปีที่แล้ว

    Hard to follow with the loud music....

  • @mszxu
    @mszxu 2 ปีที่แล้ว

    wow

  • @sarcasticdna
    @sarcasticdna 3 ปีที่แล้ว

    90% music 10% voice 😑

  • @bafian
    @bafian 2 ปีที่แล้ว

    easypez

  • @RANASOUMYA90
    @RANASOUMYA90 12 วันที่ผ่านมา

    Remove the background sound it is annoying!

  • @eswarrao8660
    @eswarrao8660 2 ปีที่แล้ว

    music is disturbing.please remove it

  • @aditiagarwal7574
    @aditiagarwal7574 หลายเดือนก่อน

    Terrible and unnecessary
    background music. The video is great but the BGM is soooo annoying and why was it even needed.

  • @sunilkumar9560
    @sunilkumar9560 2 ปีที่แล้ว

    Worst vdo due to music, people should listen your voice or music ?

  • @codewithmeer
    @codewithmeer ปีที่แล้ว

    who on the face of earth puts dumb music in tutorial videos. The student tries to focus on concept not how cool your bgm is