From fb82244f8e3c0f4423e2bac90b94b145113255d4 Mon Sep 17 00:00:00 2001 From: Artur Minin <39351305+artur-minin@users.noreply.github.com> Date: Mon, 6 May 2024 23:05:41 +0600 Subject: [PATCH] Fix typo in void operator page (#33445) Replaced "be prefixing" with "by prefixing" --- files/en-us/web/javascript/reference/operators/void/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/en-us/web/javascript/reference/operators/void/index.md b/files/en-us/web/javascript/reference/operators/void/index.md index 47237cd4d8f5152..eb026e51fc9205f 100644 --- a/files/en-us/web/javascript/reference/operators/void/index.md +++ b/files/en-us/web/javascript/reference/operators/void/index.md @@ -54,7 +54,7 @@ function () { }(); // SyntaxError: Function statements require a function name ``` -In order for the function to be parsed as an [expression](/en-US/docs/Web/JavaScript/Reference/Operators/function), the `function` keyword has to appear at a position that only accepts expressions, not statements. This can be achieved be prefixing the keyword with a [unary operator](/en-US/docs/Web/JavaScript/Guide/Expressions_and_operators#unary_operators), which only accepts expressions as operands. Function invocation has higher [precedence](/en-US/docs/Web/JavaScript/Reference/Operators/Operator_precedence) than unary operators, so it will be executed first. Its return value (which is almost always `undefined`) will be passed to the unary operator and then immediately discarded. +In order for the function to be parsed as an [expression](/en-US/docs/Web/JavaScript/Reference/Operators/function), the `function` keyword has to appear at a position that only accepts expressions, not statements. This can be achieved by prefixing the keyword with a [unary operator](/en-US/docs/Web/JavaScript/Guide/Expressions_and_operators#unary_operators), which only accepts expressions as operands. Function invocation has higher [precedence](/en-US/docs/Web/JavaScript/Reference/Operators/Operator_precedence) than unary operators, so it will be executed first. Its return value (which is almost always `undefined`) will be passed to the unary operator and then immediately discarded. Of all the unary operators, `void` offers the best semantic, because it clearly signals that the return value of the function invocation should be discarded.