LOGBOOK

HELP

1 / 19
Other keys: showSpace: good1-4: rate0: skip5: 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

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:

Illustration
Evan You, https://github.com/yyx990803 · CC BY 4.0 · Wikimedia Commons
or press any other key