I happened to meet the following strange case:
One of the network calls answered like this:
window.function1 = function() { console.log('function 1'); } window.project = 'test';
But when the following script is evaluated, it returns an error
Unexpected id
This problem is fixed when a semi-colon added after defining function1. So the correct fix is:
window.function1 = function() { console.log('function 1'); }; window.project = 'test';
I am curious to know the reason for this.
javascript semicolon minify
sachinjain024
source share