Javascript Modules | Export Import Syntax for ES6 Modules

แชร์
ฝัง
  • เผยแพร่เมื่อ 6 ก.ย. 2024

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

  • @yatin1370
    @yatin1370 8 หลายเดือนก่อน +1

    Now that I am here for a refresher, its astounding how clear I am getting in JS foundations. This will help me in another part of my upskilling journey where I will be creating web components.
    There is no better teacher out there for frontend than you Dave!

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

    Thank you Dave for teaching us these core concepts , I am learning something new everytime from your channel.

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

    Great lesson..I have really understood the import and export modules now..Keep up impacting more lives

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

    professional, concise, perfect explanations. you're always very helpful. have a nice day!

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

    Thnaks Dave you're teaching is outstanding 😊

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

    Golden content. Your detailed, clear explanations were really lifesaver for me. I hope you'll achieve your goals on TH-cam. You deserve millions of subscribers. Thanks!

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

      Thank you for the kind words! 💯

    • @nikoryu-lungma
      @nikoryu-lungma ปีที่แล้ว

      @@DaveGrayTeachesCode
      There is one thing I have to ask, though.
      In this lesson, I imported my file inside the same folder with my JS file.
      However, when I imported my file(The name of the file is "guitar.js"), then I keep getting this weird error(Even though I put them in the same folder):
      GET 127.0.0.1:5500/static/posts net::ERR_ABORTED 404 (Not Found)
      I re-checked a bunch of times, the file is still in the folder named "static", why did the browser not get it?
      Can you help me to explain this situation?

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

    Thank you Dave! I'm trying to learn something about JS every day and your channel is the main source for me. Thank you also for all the additional references like MDN website and Eloquent JS book!

  • @hertechera
    @hertechera 10 หลายเดือนก่อน +1

    Thank you so much for the clear and detailed explanations. I appreciate your work.

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

    Great job! Very easy to follow along and comprehend! 👏

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

    Thanks for giving valuable content as always Dave🙌🏼 very detailed underrated content 🔥

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

      Thank you for the kind words! 🙏💯

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

      Yeah, I have been following Dave's vids and they are being overly underrated! Some of the best Javascript lessons on youtube!

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

    ALLHAMDULILLAH🥰🥰 every point is cleared. thank you so much

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

    Very useful and fleshed out, filled in a lot of my gaps when it came to importing. I recommend watching this in 1.25x speed since he can talk a little slow lol. But that's okay.

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

      Thanks and absolutely! I do go slow for some and just right for others 🙂. Learn at the pace you are comfortable with. Thanks for watching!

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

      @@DaveGrayTeachesCode since I’m not mothertongue english I’m very glad that you are speaking slow and clear: this helps me a lot! 👍🏻

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

    Thanks, you covered precisely what I wanted to know, plus live server makes development a lot more easy and pleasant.

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

    As always detailed, crisp and to the point lecture

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

    Hey Dave! Thanks for another awesome lesson! 💛

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

    (timeline 9:17) Did the developers who created modules steal the idea from SQL when you type: "import * as Guitars from ./guitars.js"
    In SQL the * is called a wildcard. I am pretty sure me as a newbie I am getting excited with some of the terminology used here, looks similar to SQL and even C when you enter the name of the file by using ./

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

      I'm not sure of the origin, but the wildcard * exists in many areas beyond SQL and JS. For example, it is also the "select all" in CSS.

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

    Thanks for the concise lesson

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

    It doesnot work to me actually. When i wrote type="module" to script it showed me nothing, even console.log("Hello I am working") did not show in console. I dont get it. did i do something wrong?

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

      Several considerations here that I do not know about your code. If the script element is inside the head element of your html file, are you also using the defer attribute? Are you using type="module" because you are importing another javascript file? If so, did you import the file in your javascript? Search MDN for the script element docs and also for import. You'll get it!

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

      @@DaveGrayTeachesCode Thank u dave, i get it!

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

      I have same problem

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

    You are best

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

    Thank you.

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

    I got this error: Failed to load resource: the server responded with a status of 404 (Not Found)

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

    Great video. Saved me years of hair.

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

      Lol that's something I can appreciate! Thanks!

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

      @@DaveGrayTeachesCode Hey got a video on promises? That would be my next hurdle.

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

      @@adrian8729 yes, I do. It is promises, the fetch api, and using async/await: th-cam.com/video/VmQ6dHvnKIM/w-d-xo.html There is a full JS playlist :)

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

    Thank you 🙌

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

    Great tutorial, thank you.

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

    Thank you for this.

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

    thank you very much

  • @Marius-vw9hp
    @Marius-vw9hp 2 ปีที่แล้ว

    Superb video! Thanks

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

    (8:04) Rename imports
    Dealing with Identically Named Default Exports
    If you were a little bit too curious like me, then you probably tried to import 2 identically named Default Exports from 2 different modules. Then you thought I will rename one of them and this will prevent any conflicts.
    Well... JavaScript does not work that way.
    JavaScript expects each module to have a unique "Default Export" name.
    If this is not the case you will need to refactor the modules themselves,
    to ensure there is no overlap.
    📝 This note serves as a reminder for myself, if I happen to revisit the video in the future or for any future students who may encounter similar scenarios.

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

    thx bruw

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

    do you have updated tutorial for this?
    I wonder if this still works this year.

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

      Try the code. It still works. Look it up on MDN. It is still the same. No reason to wonder. Take action and find out.

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

      ok thnx