Just a short post today. I’ve been following up on the practice exercises from last time, building a class and using it to create objects. I ran into some issues with it, though — I can’t access my new class and its constructor from the browser console.
My first suspicion is that it’s because I switched browsers (formerly using the Firefox console, now using Chrome). Maybe Firefox is more forgiving in some way — but I can’t think of why this would be. Might be some way in how I imported my code into the HTML doc, but I’d be very surprised about that. I checked the template to see whether I was missing something and saw a statement of export default [ClassName], so I added that to my new class, but it didn’t make a difference.
I went into an older example of script.js from one of the non-practice lessons, which showed how to import classes, and made sure I’d set everything up right (having different JS modules imported in the right order, etc.), but still couldn’t make it work.
That’s all for today, but I think next steps will be to go through the ES6 import syntax and see if there’s anything else I can do to fix this.
Leave a Reply