每周翻译一篇前端技术英文官网(二)

本文详细解析了MDN文档中关于异步函数表达式的概念、语法及用法,包括如何使用async关键字定义异步函数,以及异步函数表达式与异步函数语句的区别。同时,文章提供了具体的例子,帮助读者更好地理解并应用这些知识点。
今天准备翻译的网站是 MDN里内容的async function expression

网址链接:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/async_function

主体部分的翻译:

原文部分:
The async function keyword can be used to define async functions inside expressions.
You can also define async functions using an async function statement.


翻译部分:
async function关键字可用于在表达式中定义异步函数
还可以使用async函数语句定义异步函数。




Syntax
语法
Parameters
参数


原文部分:
The function name.Can be omitted,in which case the function is anonymous.The name is only local to the function body.
The name of an argument to be passed to the function.
The statements which comprise the body of the function.


翻译部分:
函数名。可以省略,在这种情况下函数是匿名的。该名称仅在函数体的本地。
要传递给函数的参数的名称。
组成函数主体的语句。




Description
描述

原文部分:
An async function expression is very similar to,and has almost the same syntax as,an async function statement.The main difference between an async function expression and an async function statement is the function name,which can be omitted in async function expressions to create anonymous funtions. An async function expression can be used as an IIFE(Immediately Invoked Function Expression) which runs as soon as it is defined.See also the chapter about functions for more information.


翻译部分:
异步函数表达式与异步函数语句非常相似,语法也几乎相同。异步函数表达式和异步函数语句的主要区别在于函数名,可以在异步函数表达式中省略函数名来创建匿名函数。异步函数表达式可以用作IIFE(立即调用的函数表达式),一旦定义了它,它就会运行。有关更多信息,请参见关于函数的章节。




Examples
例子

Specifications
规格

Browser compatibility
浏览器兼容性

See also
参见

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值