Under UNIX-like OSes, a text file consists of a series of lines, each
of which ends with a `newline` character (`\n`). A file that is not
empty and does not end with a `newline` is therefore considered not to
be a text file.
Because of this, utilities that are supposed to operate on text files
may not cope well with files that don't end with a `newline` (e.g.: they
might ignore the text after the last `newline`).
Adding the `newline` character at the end of the file ensures that users
won't encounter any odd behavior when using it.
Reference/Source: http://unix.stackexchange.com/a/18789.
The HTML specification defines default values for the `type` attribute
for the `<script>`¹ and `<style>`² elements.
Browsers follow the specification so, unless a different value than the
default is needed, the `type` attribute can be omitted, being redundant.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
¹ https://html.spec.whatwg.org/multipage/scripting.html#attr-script-type
" Omitting the attribute, or setting it to a JavaScript
MIME type, means that the script is a classic script,
to be interpreted according to the JavaScript Script
top-level production. Classic scripts are affected by
the charset, async, and defer attributes. __Authors
should omit the attribute, instead of redundantly giving
a JavaScript MIME type.__ "
https://html.spec.whatwg.org/multipage/scripting.html#prepare-a-script
" 6. If either:
* the `script` element has a `type` attribute and its
value is the empty string, or
* the `script` element has no `type` attribute but it
has a `language` attribute and that attribute's value
is the empty string, or
* the `script` element has neither a `type` attribute
nor a `language` attribute, then
...let the script block's type string for this script
element be `text/javascript`. "
² https://html.spec.whatwg.org/multipage/semantics.html#attr-style-type
" The default value for the type attribute, which is used
if the attribute is absent, is `text/css`. "