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){}
            Asked
            
        
        
            Active
            
        
            Viewed 62 times
        
    -3
            
            
         
    
    
        user2304828
        
- 3
- 2
- 
                    1Not much without the surrounding context. – Teemu Nov 09 '16 at 13:02
- 
                    2You over-simplified. Please un-simplify and show us some context. – Some programmer dude Nov 09 '16 at 13:04
- 
                    1http://s1.mi.com/m/e/2063c1608d6e0baf80249c42e2be5.js you can saw the code in this website. – user2304828 Nov 09 '16 at 13:28
1 Answers
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