When you create a JS function with one parameter.
For example,
1 | function personalTest(type) |
2 | { |
3 | if(type=='A') |
4 | //to do sth |
5 | else if(type=='') |
6 | //to do sth else |
7 | } |
8 |
Please notice that if you invoke above function with “personalTest()”, you may not get correct result you expect. That’s because if you keep the parameter as blank, the ‘type’ will be equaled with ‘Undefined’. So if you want to make type==’’, you have to call the function by following way, personalTest(‘’)