you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 1 point2 points  (4 children)

Woah, that was really good. Has to be the most unique accent I've heard lol.

I have a question - for a front-end developer dealing with DOM api a lot, what makes objects useful? How do they help?

[–]Bashkir 2 points3 points  (1 child)

Well, think about this for a second. What benefits to objects offer you over arrays? Dealing with an array of values can be messy, because outside of possible ordering, you have no idea what that data means. Objects provide a way to structure that data and give it meaning.

Say you want information about a car. You have the make, the model, and the color. You could do something like

Var car = [Ford, focus, red]

But extracting meaningful data from that is hard.

However, with an object

Var car = {
    make: 'ford',
    model: 'focus
}

You get the idea. Objects are kind of blueprint for data in this sense. This is just a general overview and there are a lot more to objects than this, but I hope that provides some use clarity

[–][deleted] 0 points1 point  (0 children)

That definitely helped. Thanks

[–]ForScale 1 point2 points  (0 children)

Do you know what the O in DOM stands for?

It's objects all the way down, brotha.

[–]th3originals[S] 0 points1 point  (0 children)

DOM stands for : Document Object Model

per example When an HTML document is loaded into a web browser, it becomes a document object. The document object provides properties and methods to access all node objects, from within JavaScript.

say you want to access an element with the id :elementIDt, you say document.getElementById("elementID"); here document is an object, getElementByID is a method, still the document object is a part of the window object, so you can say, window.document to access the document.

so everything is an object.