How best to determine if an argument is not sent to the JavaScript function

后端 未结 13 649
猫巷女王i
猫巷女王i 2020-11-28 00:40

I have now seen 2 methods for determining if an argument has been passed to a JavaScript function. I\'m wondering if one method is better than the other or if one is just ba

13条回答
  •  攒了一身酷
    2020-11-28 01:17

    I'm sorry, I still yet cant comment, so to answer Tom's answer... In javascript (undefined != null) == false In fact that function wont work with "null", you should use "undefined"

提交回复
热议问题