Js in such a definition of the function, how to reference it, this is defined as a variable or a function ah?

var  zjlx=function (value){
        if(value == "IC"){
            return "";
        }
        if(value == "IF"){
            return "";
        }
        if(value == "IA"){
            return "";
        }
        
        if(value == "IP"){
            return "";
        }
        
    }
Aug.27,2021

are you new to the front end?

this is a function. Return the corresponding string

according to the specified string you passed in.

for example, if you pass in IC , and then call zjlx ('IC') , you will get a string resident ID

. If you refer to the

function, directly zjlx ('IC') quote


clipboard.png
using swatch case should be better judged by logic


this is called function expression , you can have a look at Baidu.

Menu