当前位置:网站首页>JS operators and expressions \ flow structure of functions and programs
JS operators and expressions \ flow structure of functions and programs
2022-07-21 17:19:00 【(-^_^-)】
Operator : A group of symbols that can complete data calculation
- Arithmetic operator +( Representing addition , It can also be used for string connection ) -( The minus sign can also be a minus sign ) * / %
- ++ Self increasing -- Self reduction
- ++ There are differences before and after variables
- Relational operator -- Judge the direct size relationship of data ><= etc.
== be equal to , Do not compare type values compare values
=== Congruence : In addition to the values , Types will also be compared
The result of the relational operator is True False
- Logical operators -- The associated condition && And || or ! Not
- A short circuit && A short circuit ||
- Conditional operator === Ternary operator 1?2:3
expression : The composition of operators and operands is formula , Each expression has a value
function :function: It's all right Can be used repeatedly ( Code block ) It is allowed to contain multiple executable codes
usage :
function Function name (){
Executable statement ;
}
Function call ;
The name of the function ()
Define a function with parameters :
usage :
function Function name ( Parameters ( Shape parameter ) list ( Consists of one or more variable names ) Statement ){
Executable statement ;
}
call Functions with parameters : The name of the function ( Actual parameters )
Define a function with a return value :
usage :
function Function name ( Parameters ( Shape parameter ) list ( Consists of one or more variable names ) Declared or not ){
Executable statement ;
return value ;
}
call Functions with parameters : The name of the function ( Actual parameters )
- Scope : Accessible range of variables or functions
- Function scope : Access only within the current function
- Global scope : After definition , Code can be accessed anywhere
Variable of function scope : local variable -- Only the current function can access
Global variables , Outside the function , It can only be defined once
Sequential execution 、 Branch out
边栏推荐
猜你喜欢
Kube controller manager principle
The remote control software should also have plan B alternatives
Let me tell you how a grass-roots programmer can counter attack and successfully enter bat!
Kubernetes deploy mysql5.7 (single node)
Poor CDH cluster: there are 1855 blocks with insufficient replicas in the cluster. There are 1857 blocks in the cluster. Percentage of blocks with insufficient copies: 99.89%. Critical threshold: 40.0
692. Top k high-frequency words
管程 的相关内容
1486. Array XOR operation
[pictures and texts] this article explains the JVM architecture, class file structure and bytecode structure!!
Cloud native observability tracking technology in the eyes of Baidu engineers
随机推荐
JUC并发编程 wait notify详解
@RequestParam注解的正确使用方式
Poor CDH cluster: there are 1855 blocks with insufficient replicas in the cluster. There are 1857 blocks in the cluster. Percentage of blocks with insufficient copies: 99.89%. Critical threshold: 40.0
Monitor Deep Learning Training Progress
[Interview: concurrence19: Multithreading: Park & unpark]
【面試:並發篇19:多線程:Park&Unpark】
有没有完全自主的国产化数据库技术
mysql 常用操作和基础查询
[method] determine whether exe or DLL is 32-bit or 64 bit
设计分享|单片机直流电机转速控制(汇编)
让实习生搭个Redis集群,差点把我”搭“进去~~~
[solution] VC6.0 cannot be debugged at breakpoints
Kubernetes deploy mysql5.7 (single node)
16 SQL injection test points you should pay attention to
Codeforces Round #808 (Div. 2)
Solve the problem that @valid list parameters cannot be verified
Design sharing | single chip microcomputer DC motor speed control (assembly)
华为无线设备配置同一业务VLAN的AP间快速漫游
OutOfMemoryError 内存溢出问题排查
工作经验总结1