-3

what does this code mean? I saw the code on some website. I don't know how it works. I have simplified the code. (window), function (a, b, c){}

1 Answers1

0

Read this, there are a something like:

!function(a){console.log(a+" First")}(window),
function(a){console.log(a+" Second")}(window),
function(a,b,c){console.log(a+' '+b+' '+c)}("MI_STD_CRYPTED","MI_GOODS_ID",window);

Execute the block above in the console of your browser.

In your script:

!function(a){..}(window),
function(a){..}(window),
function(a,b,c){..}("MI_STD_CRYPTED","MI_GOODS_ID",window);

i.e. we run an anonymous function with parameters in the round brackets, an anonymous function accepts these parameters as arguments:

!function(){}(),
function(a,b,c){console.log(a+' '+b+' '+c)}("this will be a","this will be b","this will be c");
Community
  • 1
  • 1