首页 >

javascript表达式有哪些

web前端|前端问答javascript表达式有哪些
javascript
web前端-前端问答
电影源码 试看,ubuntu不能用中文,tomcat7不启动,爬虫视频欣赏,约课系统php,顺德关键词seo优化代理商lzw
本文操作环境:Windows7系统、javascript1.8.5版、DELL G3电脑
android html5 源码,基于vscode购物平台,ubuntu 编译.py,tomcat启动日志设置,立春时的爬虫和端午的爬虫,php反向引用,品牌seo优化系统代理平台,单页式网站源码,destoon英文站模板lzw
javascript表达式有哪些?
二维码在线生成 源码,ubuntu怎么设置网卡,python爬虫源码分享,php判断n行n列是否有元素,宜春seo营销lzw
表达式是可以求值并解析为值的代码单元。 JS中的表达式可以分为几类。

算术表达式

字符串表达式

主要表达

数组和对象初始化器表达式

逻辑表达式

左侧表达式

属性访问表达式

对象创建表达式

函数定义表达式

调用表达式

算术表达式

在此类别下,取所有计算结果为数字的表达式:

1 / 2i++i -= 2i * 2

字符串表达式

计算结果为字符串的表达式:

'A ' + 'string'

主要表达

在此类别下,变量引用,文字和常量:

20.02'something'truefalsethis //the current objectundefinedi //where i is a variable or a constant

还有一些语言关键字:

functionclassfunction* //the generator functionyield //the generator pauser/resumeryield* //delegate to another generator or iteratorasync function* //async function expressionawait //async function pause/resume/wait for completion/pattern/i //regex() // grouping

数组和对象初始化器表达式

[] //array literal{} //object literal[1,2,3]{a: 1, b: 2}{a: {b: 1}}

逻辑表达式

逻辑表达式使用逻辑运算符并解析为布尔值:

a && ba || b!a

左侧表达式

new //create an instance of a constructorsuper //calls the parent constructor...obj //expression using the spread operator

属性访问表达式

object.property //reference a property (or method) of an objectobject[property]object['property']

对象创建表达式

new object()new a(1)new MyRectangle('name', 2, {a: 4})

函数定义表达式

function() {}function(a, b) { return a * b }(a, b) => a * ba => a * 2() => { return 2 }

调用表达式

调用函数或方法的语法

a.x(2)window.resize()

《js基础教学》


  • 暂无相关文章
  • Posted in 未分类