Consider this piece of code
function foo(a) {
return function(b) {
return a+b;
}
}
You can run this like
var x = foo(2);
var y = x(3); // y == 5
but this can be done "shorthand" like
var x = foo(2)(3); // x == 5
in your code, you have
console.log("value a:"+a +" value b:"+b);
(function (a,b){
console.log("value a:"+a +" value b:"+b);
})(20,10)
Without semicolons, javscript guesses wrong and thinks you are trying to do
console.log('')( ... )
you can make the code run in a few ways
minimal - add a single character to your code
(function(a,b){
console.log("value a:"+a +" value b:"+b); // add this colon
(function (a,b){
console.log("value a:"+a +" value b:"+b)
}(20,10))
})(30,40)
make your code shorter
(function(a,b){
console.log("value a:"+a +" value b:"+b)
// use different syntax for the inner IIFE
// add a leading !, or +, or various other characters
!function (a,b){
console.log("value a:"+a +" value b:"+b)
}(20,10)
})(30,40)
however, to avoid any pitfalls, put colons where they should be
v----- this one is optional, but may be required depending on preceding code
;(function(a,b){
console.log("value a:"+a +" value b:"+b); // here
(function (a,b){
console.log("value a:"+a +" value b:"+b) // here
}(20,10)); // here
})(30,40); // and here