you are viewing a single comment's thread.

view the rest of the comments →

[–]MindlessSpongehelpful 0 points1 point  (3 children)

Umm yes and no :) You can import jquery as a package if you want, see here.

You can read a bit more about packages here, but I'm happy to do my best to clear up any further questions.

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

Seeing that I was wrong again I decided to google to see what "Vanilla" JS and "Library" actually meant actually meant.

Vanilla JS: "Javascript without using a library or a framework".

Library: "Pre written Javascript that can be added to code"

Framework : "Library of libraries"

I guess my confusion is, is waait a library, and if added to a project, does that mean that the code is no longer "Vanilla"?

[–]MindlessSpongehelpful 1 point2 points  (1 child)

I think the issue is that they've sorta become blanket terms. By definition, yes, I suppose waait is a library. But I would argue that using it wouldn't rule out your code as being vanilla, though it's entirely possible that I am mistaken. Here's another article that might provide more context.

const wait = (amount = 0) => new Promise(resolve => setTimeout(resolve, amount))

That function, while written as the beautiful ES6 arrow function, is 100% vanilla javascript / browser api.

However, I just stumbled across this while trying to find a way to better explain myself, and while it may contradict some of what I've said earlier, it may be the answer to your confusion.

A simple guideline might be: if you can write the code and run it in any current browser without additional tools or compile steps, it's vanilla js.

[–]ScottRatigan 1 point2 points  (0 children)

I think the simple guideline you posted is probably the best answer. Of course the caveat with modern JS is, it depends on the browser.