Skip to main content

Migrating From jQuery to Vanilla Javascript Discussion

General • Asked by Chris Oliver

`document.querySelectorAll` looks like return an array, but in fact it is an object. It's important to keep this in mind in order to avoid some problems iterating the dom elements.

Hey Felipe,

Yeah, I think I know what you mean. querySelectorAll returns an object but since you can do something like object[0] to get the first element in the object, it looks like you might be working with an array. Great point.

Login or Create An Account to join the conversation.

Subscribe to the newsletter

Join 24,647+ developers who get early access to new screencasts, articles, guides, updates, and more.

    By clicking this button, you agree to the GoRails Terms of Service and Privacy Policy.

    More of a social being? We're also on Twitter and YouTube.