1 / 19
Other keys: show •
Space: good •
1-4: rate •
0: skip •
5: flag
Question
How do you include an external JavaScript file in HTML?
Answer
You link an external JavaScript file with a <script> tag whose src attribute points to the file's URL.
<script src="TextStatsLib.js"></script>
The browser loads and executes the JavaScript file at that point in the page. Functions defined in the external file become available for use in subsequent scripts or HTML event handlers.
or press any other key
Note saved — thanks!
Question
What is the difference between a JavaScript library and a framework?
Answer
You call a library's functions, whereas a framework provides the overall structure and calls your code (inversion of control).
| Library | Framework |
|---|---|
| You call library functions | Framework calls your functions |
| You control program flow | Framework controls program flow |
| Add features to your code | You build within the framework |
| Example: jQuery, Lodash | Example: Vue.js, React, Angular |
Frameworks provide a "skeleton" - you fill in the specific parts for your application.
Go deeper:
Vue.js (Wikipedia) — overview, history, and where Vue sits among front-end frameworks.
Why Vue (official intro) — the framework's own pitch: declarative rendering + reactivity vs. hand-written DOM code.
or press any other key
Note saved — thanks!