当前位置:网站首页>随笔记:重新认识 else if
随笔记:重新认识 else if
2022-06-28 23:43:00 【Run Coder】
随笔记:重新认识 else if
最近来郑州找工作了,在找工作空档期看《你不知道的Javascript 中册》的时候,看到了这个知识点,也让我重新认识了一下。
认识前
原来一直以为 else if 本身就是JavaScript这门语言的语法
就像下面的代码这样
if(1){ }else if(2){ }else{ }
认识后
else if 不是JavaScript这门语言的标准语法,而是社区朋友们根据标准语法自己发明的写法
原因:if 或者 else 后面如果只有一行语句的话,是可以省略花括号的(不推荐这样写 ️ )
非简写模式
if (1) { } else { if (2) { }else{ } }
自己的经验太少,需要学习的地方很多!每一次尝试都是一次收获,加油!
边栏推荐
- 网上注册股票开户很困难么?在线开户是安全么?
- Finally, someone explained the cloud native architecture
- Class extension and optional type extension of dart
- 从SQL注入绕过最新安全狗WAF中学习fuzz
- Mobile heterogeneous computing technology - GPU OpenCL programming (basic)
- Insomnia last night
- Hesitating root sound
- Machine learning 4-dimension reduction technology
- 华为22级专家十年心血终成云原生服务网格进阶实战文档,是真的6
- frameworks/base/core/res/res/values/symbols. Xml:3915: error: no definition for declared symbol solution
猜你喜欢

Mobile heterogeneous computing technology - GPU OpenCL programming (basic)

lock4j--分布式锁中间件--使用/实例

Auto encoder

Implementation of dynamic timer for quartz

PHP uses endroid/qrcode QR code to generate, and Gd library generates sharing posters

What are some tips to improve your interview success rate?

ctfshow XSS

Chapter II Classic synchronous exercises

The second session of question swiping and clock out activity -- solving the switching problem with recursion as the background (III)

mysql-5.7.30-winx64免安装版下载安装教程
随机推荐
想问问,股票开账户如何优惠开户?网上开户安全么?
What are the virtual machine software? What are their respective roles?
stm32F407-------NVIC中断优先级管理
What are some tips to improve your interview success rate?
Behaviortree in ros2
MySQL connection query is easy to understand
Solve the problem of Chinese parsing by configparser
股票开户在网上开通安全吗?
移动端异构运算技术 - GPU OpenCL 编程(基础篇)
ERROR 1067 (42000): Invalid default value for ‘end_time‘ Mysql
scrapy保存数据到excel:利用openpyxl创建多张表,设置Excel行数限制
CMake教程(一)
SQL note 2 [MySQL]
解决ConfigParser解析中文问题
urllib.parse 解析url连接中的参数
stm32F407-------时钟系统(SystemInit时钟初始化、Systick滴答定时器)
Oil monkey script learning
Matlab learning notes (6) upsample function and downsample function of MATLAB
stm32F407-------GPIO输入实验
Stm32f407----- register address name mapping analysis