gpt4 book ai didi

javascript - 如何使用下划线在 javascript 中检查 "undefined"?

转载 作者:行者123 更新时间:2023-12-03 17:50:33 25 4
gpt4 key购买 nike

这个问题在这里已经有了答案:





Using underscore.js for null checking

(4 个回答)



checking for undefined variable with Underscore.js

(2 个回答)


8 年前关闭。



if(typeof hello! = 'undefined'){

}

这太难打字了,想用下划线

最佳答案

根据 the official documentation ,您可以使用 _.isUndefined() :

_.isUndefined(window.missingVariable);
=> true

关于javascript - 如何使用下划线在 javascript 中检查 "undefined"?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15215316/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com