当前位置:网站首页>Judgment of single exclamation point and double exclamation point in JS
Judgment of single exclamation point and double exclamation point in JS
2022-06-13 08:47:00 【fengyehongWorld】
if (!null) {
console.log('null Judgment is executed '); // null Judgment is executed
}
if (!undefined) {
console.log('undefined Judgment is executed '); // undefined Judgment is executed
}
if (!'') {
console.log(' Empty string judgment is performed '); // Empty string judgment is performed
}
if (!' ') {
console.log(' The space string judgment is performed ');
}
if (!0) {
console.log('0 Judgment is executed '); // 0 Judgment is executed
}
console.log('---------------- Split line ----------------');
if (!!null) {
console.log(' I will not be executed , I am a null');
}
if (!!undefined) {
console.log(' I will not be executed , I am a undefined');
}
if (!!'') {
console.log(' I will not be executed , I am an empty string ');
}
if (!!' ') {
console.log(' I will be executed , I am a space string '); // I will be executed , I am a space string
}
if (!!0) {
console.log(' I will not be executed , I am a 0');
}
console.log('---------------- Split line ----------------');
// When determining whether an object is an empty object , You can use it directly ! How to judge
const obj = null;
if (obj === null || obj === undefined || obj === '') {
console.log(' I am empty , Judge by troublesome means ');
}
if (!obj) {
console.log(' I am empty , Judge in a simple way ');
}
边栏推荐
- Tmall product details interface, tmall product coupon interface, tmall API interface, tmall price monitoring interface, tmall price comparison interface, brand rights protection interface, tmall sales
- How does jupyter notebook directly output the values of multiple variables after running?
- JS ask for the day of the year
- WARNING:tornado. access:404 GET /favicon. ICO (172.16.8.1) 1.84ms [with static file settings]
- Buuctf web (VII)
- On the use of visual studio
- [leetcode weekly race record] record of the 80th biweekly race
- Pop component submission success failure animation
- MySQL 8.0 modifying SQL_ mode=only_ full_ group_ by
- Use of addeventlistener in JS
猜你喜欢

Replace jade engine with EJS

VS安装VAssistX插件导致WPF-XAML文件输入中文出现乱码问题解决方案

Installing pytorch under Anaconda

Format_ String_ Server

關於RSA加密解密原理

Problems in the deconstruction and assignment of objects, comparison between empty strings and undefined

anaconda下安装pytorch

MySQL sorts according to the specified order of the specified fields

Wechat upload picture material interface

Disk management and disk partition operation
随机推荐
Tiktok keyword search list interface, ultra detailed interface docking steps
Uni app essay
淘宝商品销量接口/淘宝商品销量监控接口/商品累计销量接口
GBase 常见网络问题及排查方法
0.一些自己初學Solidworks的疑惑
4. Relationship selector (parent-child relationship, ancestor offspring relationship, brother relationship)
Logstash failed to create queue
JS - max. of array cases
Review one flex knowledge point every day
1. Learning sequence of SolidWorks modules
Request alarm: refer policy: strict origin when cross origin or reference site policy: no refer when downgrade
浅析Visual Studio 使用
How does jupyter notebook directly output the values of multiple variables after running?
情绪处理技巧
I set up a blog
VS安装VAssistX插件导致WPF-XAML文件输入中文出现乱码问题解决方案
useRoutes() may be used only in the context of a <Router> component.
网上开户安全吗?新手可以开账户吗?
redis
Buuctf web (VII)