u/Nooder

66 post karma · 71 comment karma · joined Oct 2010 · moderator

  1. 3points

    Looking for testers - Spatial Brick Builder (self.VisionPro)

    3 comments

  2. 4points

    [FREE] ~25hr React In Depth Course w/ Exercises + Project (self.reactjs) [Resource]

    0 comments

  3. 1points

    [Tutorial] Attributes in the DOM + Exercises (self.learnjavascript)

    0 comments

  4. 2points

    [Tutorial] DOM Navigation + Exercises (self.learnjavascript)

    0 comments

  5. 1points

    [Tutorial] querySelector API + Exercises (self.learnjavascript)

    0 comments

  6. 0points

    OOP Javascript Project - RPG Game CLI (self.learnjavascript)

    0 comments

  7. 17points

    [Tutorial] Encapsulation & "static" - Object Oriented Programming (self.learnjavascript)

    16 comments

  8. 1points

    [Tutorial] Inheritance and Polymorphism + Exercises (self.learnjavascript)

    0 comments

  9. 1points

    What is the DOM - Document Object Model? (youtu.be)

    0 comments · source

  10. 0points

    New Web Developer Roadmap 2023 (youtu.be)

    3 comments · source

  11. 2points

    [Tutorial] Introduction to Classes and OOP w/ Exercises (self.learnjavascript)

    0 comments

  12. 4points

    [Tutorial] The "this" Keyword + Exercises (self.learnjavascript)

    0 comments

  13. 9points

    [Tutorial] Prototypes and Prototypal Inheritance + Exercises (self.learnjavascript)

    0 comments

Nooder

Thanks! You're very welcome, the more apps we have and ideas tossed around the better :)

Nooder

Yes, cyclical references would cause an error in this method as well as things like JSON.parse/stringify. They have methods to track if these exist and throw 🤓

Nooder

Interesting, thanks for posting this! 🤔

Nooder

Thanks for the detailed response! What's interesting is there's actually a new Web API to do this both ways: https://developer.mozilla.org/en-US/docs/Web/API/structuredClone

A deep copy would definitely need recursion since we wouldn't know the amount of nesting. This would be very similar to how JSON.stringify and JSON.parse would work.

Nooder

Hey Jack!
Nice, so detailed haha. Ideally a deep clone that preserves the prototype of the original object but is a perfect deep copy. It should have the same property descriptors and this bindings and not have any references to the original object apart to its prototype. Hope that isn't too complicated 😄

Nooder

Hey Kap, very nice addition and clarification! 🥳 It's truly quite amazing all the nuances in JS. It's funny because it makes you realize that it's actually more involved than the more "traditional" OOP langs, because of how everything works through the prototype system 🤓

Nooder

Hey Senocular!

Very nice explanation and good catch! You're right technically the way I explained it as being in the chain is a bit wishy washy. Thinking about it in the context of scope makes way more sense. 😃

I've never seen such an example that really shows how it's truly the scope that matters, nice one - very cool! It's funny how there's so much going on in that example too, like how it has closure hence the access to the scope later 🤓

Nooder

Hey Jack! I'd love to see a nice vanilla method for cloning if you have one. There are several ways and some are way more convoluted than other, haha 😃

Nooder

Hey Jack! Thanks for the response and your experience. It's awesome that you learned through the REPL haha, as most people would get frustrated pretty quickly with it :)

I think the main reason I mentioned in Node is that it's way too easy to mix up what is in the DOM in the browser (querySelector, Events, Elements etc) with being part of Javascript (those are all not JS). Granted, it's also possible to do this with Node but you have to be a bit more deliberate to mix up the Node APIs with what's in vanilla JS 😃

Nooder

I've got 2 on my channel, one intermediate and one advanced that goes pretty deep in to OOP:

Intermediate: https://www.youtube.com/playlist?list=PLovN13bqAx7BhiEIj7vJh33upvOOkkwqK

Advanced: https://www.youtube.com/playlist?list=PLovN13bqAx7AYYYgNbd1cvUeiFlBZDeFq

Nooder

Hey everyone!

I’ve been developing an in-depth JavaScript series for free on YouTube with 70+ videos at 40+ hours of content.

You can check it out here: https://www.youtube.com/playlist?list=PLovN13bqAx7D_MFjL0PHnCkYAHMSO8-kU

We cover everything from primitive types all the way up to the more advanced topics like prototypes and classes. I’ll be finishing up OOP concepts in the next couple of weeks followed by a capstone project for the whole series before moving on to the DOM in the next series.

Would love any feedback you may have! 😊

Nooder

I recently created a server as a companion to a series to teach beginners coding and JavaScript. It’s much smaller at the moment and we help each other out and answer questions quite quickly. 😃

Fee free to join if you’re interested: https://discord.gg/Qkc62kpsKr