defaultSelected Optional
A Boolean that sets the selected attribute value, i.e. so that this will be the default value selected in the element when the page is first loaded. If this is not specified, a default value of false is used. Note that a value of true does not set the option to selected if it is not already selected.
let foo = new Date();
foo.toISOString();
// -> "2019-07-31T09:11:39.715Z"
Q. I get an error message stating that an API method is not available
A. Very likely you are using a jQuery object rather than a DataTables API instance. The form $().dataTable() will return a jQuery object, while $().DataTable() returns a DataTables API instance. Please see the API documentation for further information.
Как соблюсти файловую структуру проекта (отдельные файлы скриптов и html)
const script = document.createElement('script');
script.src = '/path/to/scriptName.js';
document.head.appendChild(script);