今天准备翻译的网站是 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
参见