You are correct that this is an issue when writing JavaScript without semicolons, but it's also an issue if you place an IIFE (immediately invoked function expression) directly after a function, even if you're using semicolons:
function hasSemicolons() {
console.log('hello world');
}
(function() {
console.log('this is broken, JS will call hasSemicolons()');
})()
In the ImmortalDB example, since it's a standalone <script> tag this is just extra defensive against a minifier that would join the tag with other tags, but just wanted to call out that there's a reason to include the leading semicolon in front of an IIFE whether or not you write your JavaScript with semicolons.See also: https://stackoverflow.com/questions/1873983/what-does-the-le...