async vs defer attributes in Javascript | Ola Interview Question

แชร์
ฝัง
  • เผยแพร่เมื่อ 15 ต.ค. 2024
  • 1. What is Async and defer?
    2. Difference between async and defer attributes?
    3. When should I use defer over async?
    4. Examples of scenarios covering async and defer
    If you get to learn something from this video then do give it a thumbs up and subscribe to my channel for more such videos.
    If you want me to cover any specific topic, then comment down below. I would be happy to help you.
    If you find my videos helpful,
    then please support this channel by buying a coffee,
    www.buymeacoff...
    Cheers,
    Akshay Saini
    akshaysaini.in
    Would love to Stay Connected with you ❤️
    LinkedIn - / akshaymarch7
    Instagram - / akshaymarch7
    Twitter - / akshaymarch7
    Facebook - / akshaymarch7
    #Javascript #JavascriptInterviewQuestions #AkshaySaini

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

  • @yoshitaarora4180
    @yoshitaarora4180 4 ปีที่แล้ว +176

    i am able to ace by frontend interviews just because of you man. Thank you so much for your efforts. This world needs more people like you. Can't thank enough. Keep up the great work! 👍🏻

    • @akshaymarch7
      @akshaymarch7  4 ปีที่แล้ว +15

      Congratulations, Yoshita!! ✌🏼
      So happy to know about this, feeling proud. 😇
      Keep up the good work, champ! 🔥

    • @yoshitaarora4180
      @yoshitaarora4180 4 ปีที่แล้ว +5

      @@akshaymarch7 thanks so much Akshay. 🔥🙏🏻

    • @prashanttiwari120
      @prashanttiwari120 4 ปีที่แล้ว +3

      @@akshaymarch7 Man you are great

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

      miss, what would you cover like what are the hot topics and questions one should cover before interview and did you get asked questions on data structures and algorithms.

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

      congos buddy

  • @AnkitTiwari-lu2tt
    @AnkitTiwari-lu2tt 4 ปีที่แล้ว +14

    I had read the docs just couple of days before and now I watched your video. Understanding from docs took too much time and they didn't get fit in my mind and after watching your video the usecase of async and defer is crystal clear, that too within 8 minutes. Thanks Akshay I am totally utilising your series of Core Javascript fundamentals in this COVID-19 lockdown phase.

  • @neyaznak
    @neyaznak 10 หลายเดือนก่อน +2

    Akshay's explanations are incredibly valuable. 8 minutes of your insightful guidance surpasses any 2-minute read. Your teaching is truly exceptional! ❤

  • @naruto5437
    @naruto5437 5 ปีที่แล้ว +21

    good channel....good to have a channel devoted to UI interviews

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

    This was the best video on async and defer attributes. Thank you Akshay

  • @imharishsambasivam
    @imharishsambasivam 4 ปีที่แล้ว +7

    Fell in love with your videos💛.Thanks to linkedIn community for introducing you to me

  • @dev-suresh
    @dev-suresh 4 หลายเดือนก่อน

    Thank you Akshay bhai.. Over the past year, these videos have helped a lot.

  • @adityasmksaxena
    @adityasmksaxena 5 ปีที่แล้ว +3

    Akshay, This is awesome. Clear explanation. Thank you.

  • @mindblowing2895
    @mindblowing2895 ปีที่แล้ว +9

    Hi Akshay, First of all, Salute your efforts 🙌 You are doing an incredible contribution toward the developer community. I'm here after completing my "NAMASTE REACT 🚀" Episode 01 - Inception and completing my assignment. You have a completely different way to teach. In this video, you have magically fed the async and defer concepts in my mind. Right now I am preparing for my React Frontend Developer Interview. Your videos helped me a lot. I also watched your "NAMASTE JAVASCRIPT" series. Such knowledge-heavy content you have generated. Thank you so much. Keep it up man😎😎😎😎

    • @CharanGs-t4i
      @CharanGs-t4i ปีที่แล้ว +1

      Hey , is it ok if we can connect . i have some doubts

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

    Amazing Personality... while making us understand i can see the confidance in your body language.

  • @RV-kl2wl
    @RV-kl2wl 2 ปีที่แล้ว

    Superb video. These concepts are very imp however you read about them only after the failed interview. I have been using react and web pack from 4 year and learned this concept only after failing interview.

  • @varaprasad4163
    @varaprasad4163 4 ปีที่แล้ว +14

    Hi Akshay! I am eagerly waiting for concepts such as async/await, asynchronous and synchronous, promises.

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

    You make everything look simple and easy!

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

    Thanks Akshay for Crystal clear explanation.

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

    Explained very well and in an easy manner. It would be helpful if you can share video series for a small project which will cover the CRUD operation of data-base - parse through java (using hibernate)- Display on Screen using Angular. It will cover most of the imp topic from a full-stack developer perspective.

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

      Good point, If you got such a demo please share me link here, I will wait even for years.

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

    Man i wish you have added the "browser is the greatest thing that happened to mankind" line here too.. feels like it deserves it. Love u bro

  • @Faruk-zt5iw
    @Faruk-zt5iw 2 ปีที่แล้ว

    Thank you so much Akshay. Your videos helped me a lot during interviews.

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

    Very helpful and better than a lot of paid courses. Amazing.

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

    When it comes to Javascript, You are the best.

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

    Hey Akshay. I've been watching your videos for the past 2 days. One thing I observed is that even though I know the topic and have some understanding of the concepts. I'm still learning something new from your video and that gives me goosebumps. I feel like this is the part that I actually wanted to understand and now I know it. I'm loving it! Excited for many more new videos. I would like to have a series on how to crack Front end interviews with step by step guide in FAANG with coding problems and solutions. If it's already there. I would love to have the video link to the playlist. ☮ 😄

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

    The ways you try to make every javascript concept so easy to understand for everyone is just so great. I am short words to explain how much helpful your videos are and to thank you for all the effort.

  • @parmarav1
    @parmarav1 5 ปีที่แล้ว +2

    Hi Akshay,
    Thanks for the clear explanation. If you can please explain Preload and Prefetch attributes, that would be of great help.
    Topics that I can suggest are -
    1. Design interview questions for Web Engineers
    2. Data Structure and Algorithms to cover.
    Thanks

    • @akshaymarch7
      @akshaymarch7  5 ปีที่แล้ว

      Thanks for your suggestion Anshul, I've noted them down and will plan them in my upcoming videos 😊

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

    If you explain with example then its fully understand. Thanks for this video

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

    Thank you Sir.
    Your videos are very helpful and to the point

  • @pavankumar-of4ew
    @pavankumar-of4ew 2 หลายเดือนก่อน

    clear explanation , wow! super Akshay

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

    great explanation Akshay keep uploading video like these...thanks man

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

    Hi Akshay, I watched all of the videos on your channel!! Thanks for the awesome work!!

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

    I love this video...I just love how he explained in a simple way

  • @akshay-yeole
    @akshay-yeole 2 ปีที่แล้ว

    Interviewer asked me whether I follow Akshay Saini videos when I was explaining closure to him..You are rocking bro..keep it up..thanks for the videos...

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

    superb explanation sir ! coming from the namaste react homework

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

    Akshay once again I can't stop myself to say you Amazing ....Out of the Box......Your Namaste JavaScript will tell you Namaste Akshay ❤️❤️❤️. Outstanding yaar

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

    Thanks bro for the amazing explanation. I was confused after reading docs on various pages...

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

    Hi Akashay, I want you to know this. I know you from your posts on linkedin. I googled frontend interview and your picture came on search. I left all other videos amd started watching. This is first video that I am watching and It was great! I never knew this concept, I can also propose this solution at my current work. You not only earned a sub, but also a fan follower. Love you! And more power to you.

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

    never understood it better than Now. Thanks a lot Akshay

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

    Your videos are helpful to crack interviews. Thanks so much bro.

  • @priyaranjan1733
    @priyaranjan1733 5 ปีที่แล้ว +24

    At 3:14 you came like #TheFlash ⚡
    anyway thank you again Akshay!

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

    Thank you!!! Finally, I got this concept, appreciate it

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

    Nicely Explained!...I have one question, what if we put normal script tag at the bottom of content?

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

    Fully Cleared and you have solved one of my issues in our Internship Project. Thanks a lot Sir

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

    You saved my most of the time, now I can go and close the spike

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

    Thanks Man..Fantastic explanation...ANd also I need angular js interview tricky questions.kindly do the needful

  • @vijaykumar-wq9db
    @vijaykumar-wq9db 4 ปีที่แล้ว +1

    Thank you, dear...Nice explanation!!!

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

    Isn't using defer the best choice if you don't need to load the scripts in a rush? I mean, if we can allow any script to be loaded after the initial rendering, then using defer is a wise choice, as it will not block the rendering and will help us in achieving the right metric for initial contentful paint

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

    Please create videos on concepts like Web Workers, Service Workers, PWAs, IndexDB.
    When to use which concept?
    How to improve the performance of a web page using the above concepts?
    Any practical examples where the company is using the specific concept to solve the performance bottleneck.
    The way you explain the concept is really amazing.

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

    Thanks bro, I learned this concept today from you.

  • @Amalnajah-b2v
    @Amalnajah-b2v 2 ปีที่แล้ว

    i like you, you explain it clearly n simplly thank you

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

    Subscribed forever ❤️❤️ also , the explanation was well composed.. 👍

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

    Learned so much , did not know about this. Thanks Akshay, you are the only youtuber who makes so much of difference in my career path. May you be the greatest js teacher in the world.

  • @Happiness-z7l
    @Happiness-z7l 2 ปีที่แล้ว

    Akshay you believe it or not you make JS the most beautiful thing on earth😍😍😍
    Congrats man

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

    💡One more thing Akshay. "defer" will start executing the javascript code just before "DomContentLoaded" event being thrown, but "async" and "DomContentLoaded" won't wait for each other.
    Nicely explained 👏🏼

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

    Excellent as always, my friend!

  • @up.nijuner7738
    @up.nijuner7738 2 ปีที่แล้ว

    what an use full video ... thank you

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

    Hi bro,
    Thank you for the videos. U help us to get understand more about js. Hats off to you brother for sharing th e knowledge..wish u a great life..👍

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

    Nice.... Very Nice Video... very well explained !

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

    The visualisation was perfect

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

    Greatly taught Akshay, Keep up the good work

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

    Thankyou sir..nicely explained

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

    🥰🥰🥰🥰🥰🥰🥰 Superb Explanation.
    Thank you so much Sir.

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

    Thanks akshay .. Can you pls also come up with design pattern

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

    Thank you for discussing when to use. I am happy I learnt it!!

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

    Best way to remember defer one ( other two you know properly the simple one and the async one)
    Defer: Why named defer
    The choice of the term "defer" is descriptive of this behavior. When you defer something, you postpone it to a later time. In the case of defer attribute, it postpones the execution of the script until after the parsing of the HTML document is complete.

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

    Thank you very well explained.

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

    Good Explanation, Thanks for the video!

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

    Good efforts, for me it was very useful but could be more better. Good try. Thanks keep going.

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

    Hi Thanks for your awesome vedio. Could you please provide vedio on Clousers & ES6 features

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

    You have a commanding and towering personality like motivational Guru Tony Robins

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

    Hey Akshay, you're gem. The way you explain the topics is very clear and concise. Its become a habit for me to watch your videos and read your linkedin posts. Thank You brother for amazing content :)

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

    akshay Thanks! try TO post videos on ES6 tricky use case ..

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

    Thank you for giving good clearity.

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

    made it simple to understand thanks

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

    Great Explanation Sir.

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

    Very nice presentation!

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

    Great videos!! That would be so helpful if you can make one video on promises and async await.I guess only this is left to cover up.

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

    uber office ka sahi istmal ho raha hai....😅love u akshay❤❤ wainting for react webseries💖

  • @Daisy01-M
    @Daisy01-M หลายเดือนก่อน

    Amazing Explanation!!

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

    Akshay thanks for these videos, they are amazing!

  • @dr.shreyas123
    @dr.shreyas123 3 ปีที่แล้ว

    Hi Akshay, any plan to make videos on react? Please do 🙏

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

    maza aa gya sirji, jabardast samjhaya aapne, bohut dino se ye mujhe samajh nhi aa rha tha, kaha kaha se padha fir bhi koi faida nhi hua, subscribe kar deta hoon

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

    akshay, In firsṭ case you said HTML rendering will stop and JS file will render. But I read by default, a JS file will be rendered only at at last (after HTMl, CSS, images

  • @GauravGoyal1911
    @GauravGoyal1911 5 ปีที่แล้ว +5

    Hi Akshay,
    Thank you so much for these wonderful videos. I am regularly watching your videos.
    Is it possible for you to cover below topics in upcoming videos:
    Garbage Collection in JS
    Performance Optimisation in Client Side
    Regards,
    Gaurav Goyal

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

    Bro can you brifly explain difference between using of external JavaScript and tag

  • @hrithikgavankar7845
    @hrithikgavankar7845 9 วันที่ผ่านมา

    Crisp and on point!

  • @SushilKumar-ig8ls
    @SushilKumar-ig8ls 3 ปีที่แล้ว

    Thank you for the superb content you provide. Hats off to you and so many thanks.
    I have a question, it may sound dumb but I want to know as I have seen in many scripts. Below is the question:
    What if we use async and defer in a single script tag ? Does the order matters like... async and then defer or defer and then async ? Or these both have precedence over each other like defer will dominate async or something else ?

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

      if you specify both, async takes precedence on modern browsers, while older browsers that support defer but not async will fallback to defer.

    • @SushilKumar-ig8ls
      @SushilKumar-ig8ls 3 ปีที่แล้ว

      @@yogibaba6008 Thanks for your reply

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

    good explanation normal vs async vs defer

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

    Awesome. I loveed this class.

  • @AnkitKumar-xl7jf
    @AnkitKumar-xl7jf ปีที่แล้ว

    Hi Akshay
    My question is
    In normal systems without using the async and the defer tags
    Is there any definite time till which the parsing occurs before the scripts are being fetched from the network?

  • @brindhad7787
    @brindhad7787 2 หลายเดือนก่อน +1

    Thank you Akshay!

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

    So what is best to increase website speed? without breaking website

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

    Yeah... that's quite useful sir ! thankful to you ;)

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

    please teach about promises in JavaScript.. what they are? and why to use? and what is it's advantages?
    please please make a video for this, or provide me link if you already did it..

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

    Nicely explained.

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

    Super explanation brother

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

    Apart from the valuable knowledge, I saw flash in real life 😜

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

    Your videos helped me a lot

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

    explained very well.

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

    Perfect explanation

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

    Very well explained

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

    Nice Explanation

  • @m.smanoj4688
    @m.smanoj4688 6 หลายเดือนก่อน

    async and defer are useful when we are including script tag at the head section, otherwise including script tag at the end of the body tag is just like defer

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

    Nicely Explained