Skip to content

Instantly share code, notes, and snippets.

{"lastUpload":"2020-03-15T16:51:05.327Z","extensionVersion":"v3.4.3"}
  1. Are jQuery and React both libraries or one is framework?
  2. Apart from understanding the old code when working on old project files, will I encounter jQuery that much? I understand developers now prefer either plain JavaScript or React etc. over jQuery. Is that true?
  3. Some say learning jQuery has negative effect on your JavaScript learning capabilities - true?
  4. jQuery is a huge library and makes app slower, than say plain JS or React - is that true?
  5. No more queries for now, but will add once I have, is that okay?

1. What is scope? Your explanation should include the idea of global vs. block scope. A scope is locale accessible to a variable based on where its declared. There can only be two scopes, global or local. A local scope is the one where variable is declared within a function, whereas a global scope if for varaibles declared anywhere else outside of a function. Global scopes can be mutated from anywhere in the code file or files, whereas the local scoped variables can only be changed within the function and then it will disappear after the function is invoked, without making any changes to the outside world. Its always recommended to create local scoped variables for reliable code, unless in exceptional edge cases where global scoped variable is a must.

Why are global variables avoided? It allows for mutation of variables in unknown places, making the code prone to unintended results, and hence making