diff --git a/files/en-us/learn/javascript/building_blocks/looping_code/index.md b/files/en-us/learn/javascript/building_blocks/looping_code/index.md index 490e81818f94e48..f974c6f2c81950c 100644 --- a/files/en-us/learn/javascript/building_blocks/looping_code/index.md +++ b/files/en-us/learn/javascript/building_blocks/looping_code/index.md @@ -161,7 +161,7 @@ for (const cat of cats) { In this example, `for (const cat of cats)` says: 1. Given the collection `cats`, get the first item in the collection. -2. Assign it to the variable `cat` and then run the code between the curly brackets `{}`. +2. Assign it to the variable `cat` and then run the code between the curly braces `{}`. 3. Get the next item, and repeat (2) until you've reached the end of the collection. ### map() and filter() diff --git a/files/en-us/learn/javascript/first_steps/a_first_splash/index.md b/files/en-us/learn/javascript/first_steps/a_first_splash/index.md index 95549b5d8f46d43..9833a1a19d5f140 100644 --- a/files/en-us/learn/javascript/first_steps/a_first_splash/index.md +++ b/files/en-us/learn/javascript/first_steps/a_first_splash/index.md @@ -426,10 +426,10 @@ This is because of the loop. The line `const fruits = ['apples', 'bananas', 'che A `for...of` loop gives you a way to get each item in the array and run some JavaScript on it. The line `for (const fruit of fruits)` says: 1. Get the first item in `fruits`. -2. Set the `fruit` variable to that item, then run the code between the `{}` brackets. +2. Set the `fruit` variable to that item, then run the code between the `{}` curly braces. 3. Get the next item in `fruits`, and repeat 2, until you reach the end of `fruits`. -In this case, the code inside the brackets is writing out `fruit` to the console. +In this case, the code inside the curly braces is writing out `fruit` to the console. Now let's look at the loop in our number guessing game — the following can be found inside the `resetGame()` function: diff --git a/files/en-us/learn/javascript/objects/basics/index.md b/files/en-us/learn/javascript/objects/basics/index.md index dc1a26896ed3746..be543f75ff3b318 100644 --- a/files/en-us/learn/javascript/objects/basics/index.md +++ b/files/en-us/learn/javascript/objects/basics/index.md @@ -176,7 +176,7 @@ person.age; person.name.first; ``` -You can instead use brackets: +You can instead use square brackets: ```js person["age"]; @@ -187,7 +187,7 @@ This looks very similar to how you access the items in an array, and it is basic It is no wonder that objects are sometimes called **associative arrays** — they map strings to values in the same way that arrays map numbers to values. Dot notation is generally preferred over bracket notation because it is more succinct and easier to read. -However there are some cases where you have to use brackets. +However there are some cases where you have to use square brackets. For example, if an object property name is held in a variable, then you can't use dot notation to access the value, but you can access the value using bracket notation. In the example below, the `logProperty()` function can use `person[propertyName]` to retrieve the value of the property named in `propertyName`. diff --git a/files/en-us/learn/server-side/django/development_environment/index.md b/files/en-us/learn/server-side/django/development_environment/index.md index fd52c2b03f0f317..45af8b74e27e765 100644 --- a/files/en-us/learn/server-side/django/development_environment/index.md +++ b/files/en-us/learn/server-side/django/development_environment/index.md @@ -325,7 +325,7 @@ Now you can create a new virtual environment with the `mkvirtualenv` command Once you've installed _virtualenvwrapper_ or _virtualenvwrapper-win_ then working with virtual environments is very similar on all platforms. -Now you can create a new virtual environment with the `mkvirtualenv` command. As this command runs you'll see the environment being set up (what you see is slightly platform-specific). When the command completes the new virtual environment will be active — you can see this because the start of the prompt will be the name of the environment in brackets (below we show this for Ubuntu, but the final line is similar for Windows/macOS). +Now you can create a new virtual environment with the `mkvirtualenv` command. As this command runs you'll see the environment being set up (what you see is slightly platform-specific). When the command completes the new virtual environment will be active — you can see this because the start of the prompt will be the name of the environment in parentheses (below we show this for Ubuntu, but the final line is similar for Windows/macOS). ```bash mkvirtualenv my_django_environment diff --git a/files/en-us/learn/server-side/django/generic_views/index.md b/files/en-us/learn/server-side/django/generic_views/index.md index 7b39e508df6a8c9..25d64b09085ccc4 100644 --- a/files/en-us/learn/server-side/django/generic_views/index.md +++ b/files/en-us/learn/server-side/django/generic_views/index.md @@ -308,7 +308,7 @@ The main parts of the syntax you will need to know for declaring the pattern mat ( ) - Capture the part of the pattern inside the brackets. Any captured values + Capture the part of the pattern inside the parentheses. Any captured values will be passed to the view as unnamed parameters (if multiple patterns are captured, the associated parameters will be supplied in the order that the captures were declared). diff --git a/files/en-us/learn/server-side/django/introduction/index.md b/files/en-us/learn/server-side/django/introduction/index.md index 5e396e744be4148..e278921ff8df900 100644 --- a/files/en-us/learn/server-side/django/introduction/index.md +++ b/files/en-us/learn/server-side/django/introduction/index.md @@ -144,7 +144,7 @@ def index(request): > **Note:** A little bit of Python: > > - [Python modules](https://docs.python.org/3/tutorial/modules.html) are "libraries" of functions, stored in separate files, that we might want to use in our code. Here we import just the `HttpResponse` object from the `django.http` module so that we can use it in our view: `from django.http import HttpResponse`. There are other ways of importing some or all objects from a module. -> - Functions are declared using the `def` keyword as shown above, with named parameters listed in brackets after the name of the function; the whole line ends in a colon. Note how the next lines are all **indented**. The indentation is important, as it specifies that the lines of code are inside that particular block (mandatory indentation is a key feature of Python, and is one reason that Python code is so easy to read). +> - Functions are declared using the `def` keyword as shown above, with named parameters listed in parentheses after the name of the function; the whole line ends in a colon. Note how the next lines are all **indented**. The indentation is important, as it specifies that the lines of code are inside that particular block (mandatory indentation is a key feature of Python, and is one reason that Python code is so easy to read). Views are usually stored in a file called **views.py**. diff --git a/files/en-us/learn/tools_and_testing/client-side_javascript_frameworks/svelte_getting_started/index.md b/files/en-us/learn/tools_and_testing/client-side_javascript_frameworks/svelte_getting_started/index.md index 48f21e7ba6a37bb..7e6ef9a224455b1 100644 --- a/files/en-us/learn/tools_and_testing/client-side_javascript_frameworks/svelte_getting_started/index.md +++ b/files/en-us/learn/tools_and_testing/client-side_javascript_frameworks/svelte_getting_started/index.md @@ -240,7 +240,7 @@ Svelte uses the [`export`](/en-US/docs/Web/JavaScript/Reference/Statements/expor ### The markup section -In the markup section you can insert any HTML you like, and in addition you can insert valid JavaScript expressions inside single curly brackets (`{}`). In this case we are embedding the value of the `name` prop right after the `Hello` text. +In the markup section you can insert any HTML you like, and in addition you can insert valid JavaScript expressions inside single curly braces (`{}`). In this case we are embedding the value of the `name` prop right after the `Hello` text. ```html
diff --git a/files/en-us/learn/tools_and_testing/client-side_javascript_frameworks/svelte_typescript/index.md b/files/en-us/learn/tools_and_testing/client-side_javascript_frameworks/svelte_typescript/index.md index 75486e63b154ad2..24761c75898ec25 100644 --- a/files/en-us/learn/tools_and_testing/client-side_javascript_frameworks/svelte_typescript/index.md +++ b/files/en-us/learn/tools_and_testing/client-side_javascript_frameworks/svelte_typescript/index.md @@ -818,7 +818,7 @@ Our stores have already been ported to TypeScript, but we can do better. We shou ### Understanding TypeScript generics -Generics allow us to create reusable code components that work with a variety of types instead of a single type. They can be applied to interfaces, classes, and functions. Generic types are passed as parameters using a special syntax: they are specified between angle-brackets, and by convention are denoted with an upper-cased single char letter. Generic types allows us to capture the types provided by the user to be used later. +Generics allow us to create reusable code components that work with a variety of types instead of a single type. They can be applied to interfaces, classes, and functions. Generic types are passed as parameters using a special syntax: they are specified between angle brackets, and by convention are denoted with an upper-cased single char letter. Generic types allows us to capture the types provided by the user to be used later. Let's see a quick example, a simple `Stack` class that lets us `push` and `pop` elements, like this: diff --git a/files/en-us/mdn/writing_guidelines/howto/write_an_api_reference/index.md b/files/en-us/mdn/writing_guidelines/howto/write_an_api_reference/index.md index 518828e05c69fb6..7ecb58fa7c04871 100644 --- a/files/en-us/mdn/writing_guidelines/howto/write_an_api_reference/index.md +++ b/files/en-us/mdn/writing_guidelines/howto/write_an_api_reference/index.md @@ -313,7 +313,7 @@ Create your method pages as subpages of the interface they are implemented on. C Method pages need the following sections: -1. **Title**: the title of the page must be **InterfaceName.method()** (with the two terminal parentheses), but the slug (the end of the page URL) must not include the brackets. Also the interface name must start with a capital. Although an interface is implemented in JavaScript on the prototype of objects, we don't put `.prototype.` in the title, like we do in the [JavaScript reference](/en-US/docs/Web/JavaScript/Reference). +1. **Title**: the title of the page must be **InterfaceName.method()** (with the two terminal parentheses), but the slug (the end of the page URL) must not include the parentheses. Also the interface name must start with a capital. Although an interface is implemented in JavaScript on the prototype of objects, we don't put `.prototype.` in the title, like we do in the [JavaScript reference](/en-US/docs/Web/JavaScript/Reference). 2. **\\{{APIRef}}**: Include the \\{{APIRef}} macro in the first line of each method page, including the name of the API as an argument, so for example \\{{APIRef("Web Audio API")}}. This macro serves to construct a reference menu on the left-hand side of the interface page, including properties and methods, and other quick links as defined in the [GroupData](https://github.com/mdn/content/blob/main/files/jsondata/GroupData.json) macro (ask someone to add your API to an existing GroupData entry, or to create a new one, if it isn't already listed there). The menu will look something like the below screenshot. ![This screenshot shows a vertical navigation menu for the OscillatorNode interface, with multiple sublists for methods and properties, as generated by the APIRef macro ](apiref-links.png) 3. **Standardization status**: Next, the banner indicating the standardization status should be added (these can be placed on the same line as the \\{{APIRef}} macro): diff --git a/files/en-us/mozilla/add-ons/webextensions/api/declarativenetrequest/rulecondition/index.md b/files/en-us/mozilla/add-ons/webextensions/api/declarativenetrequest/rulecondition/index.md index 4aa3bde54b5c108..77e4d72ddcfc81d 100644 --- a/files/en-us/mozilla/add-ons/webextensions/api/declarativenetrequest/rulecondition/index.md +++ b/files/en-us/mozilla/add-ons/webextensions/api/declarativenetrequest/rulecondition/index.md @@ -71,7 +71,7 @@ Domains specified in `initiatorDomains`, `excludedInitiatorDomains`, `requestDom - The entries must consist of only _lowercase_ ASCII characters. - Use [Punycode](https://en.wikipedia.org/wiki/Punycode) encoding for internationalized domains. - IPv4 addresses must be represented as 4 numbers separated by a dot. -- IPv6 addresses should be represented in their canonical form, wrapped in brackets. +- IPv6 addresses should be represented in their canonical form, wrapped in square brackets. To programmatically generate the canonical domain for a URL, use the [URL API](/en-US/docs/Web/API/URL) and read its `hostname` property, i.e., `new URL(url).hostname`. diff --git a/files/en-us/mozilla/firefox/releases/27/index.md b/files/en-us/mozilla/firefox/releases/27/index.md index 6aa24a0ad819779..971505911e2e8d5 100644 --- a/files/en-us/mozilla/firefox/releases/27/index.md +++ b/files/en-us/mozilla/firefox/releases/27/index.md @@ -31,7 +31,7 @@ More details in [this post](https://hacks.mozilla.org/2013/11/firefox-developer- - Experimental support of `position:sticky` is now active by default on non-release builds ([Firefox bug 902992](https://bugzil.la/902992)). For releases builds, the `layout.css.sticky.enabled` preference still needs to be set to `true`. - The {{cssxref("all")}} shorthand property has been added ([Firefox bug 842329](https://bugzil.la/842329)). - The {{cssxref("unset")}} global value has been added; it allows to reset any CSS property ([Firefox bug 921731](https://bugzil.la/921731)). -- Curly brackets are no longer allowed in HTML `style` attributes: doing `
` was working in quirks mode, but won't anymore [Firefox bug 915053](https://bugzil.la/915053). +- Curly braces are no longer allowed in HTML `style` attributes: doing `
` was working in quirks mode, but won't anymore [Firefox bug 915053](https://bugzil.la/915053). - The {{cssxref("overflow")}} property now works on {{HTMLElement("fieldset")}} ([Firefox bug 261037](https://bugzil.la/261037)). ### HTML diff --git a/files/en-us/web/api/htmlselectelement/index.md b/files/en-us/web/api/htmlselectelement/index.md index 8de07944f36ab6b..b6114f632830f1f 100644 --- a/files/en-us/web/api/htmlselectelement/index.md +++ b/files/en-us/web/api/htmlselectelement/index.md @@ -63,9 +63,9 @@ _This interface inherits the methods of {{domxref("HTMLElement")}}, and of {{dom - {{domxref("HTMLSelectElement.focus()")}} {{deprecated_inline}} - : Gives input focus to this element. _This method is now implemented on {{domxref("HTMLElement")}}_. - {{domxref("HTMLSelectElement.item()")}} - - : Gets an item from the options collection for this {{HTMLElement("select")}} element. You can also access an item by specifying the index in array-style brackets or parentheses, without calling this method explicitly. + - : Gets an item from the options collection for this {{HTMLElement("select")}} element. You can also access an item by specifying the index in square brackets or parentheses, without calling this method explicitly. - {{domxref("HTMLSelectElement.namedItem()")}} - - : Gets the item in the options collection with the specified name. The name string can match either the `id` or the `name` attribute of an option node. You can also access an item by specifying the name in array-style brackets or parentheses, without calling this method explicitly. + - : Gets the item in the options collection with the specified name. The name string can match either the `id` or the `name` attribute of an option node. You can also access an item by specifying the name in square brackets or parentheses, without calling this method explicitly. - {{domxref("HTMLSelectElement.remove()")}} - : Removes the element at the specified index from the options collection for this `select` element. - {{domxref("HTMLSelectElement.reportValidity()")}} diff --git a/files/en-us/web/api/window/alert/index.md b/files/en-us/web/api/window/alert/index.md index 2609bb7a94a29a0..d04ece248b6ba89 100644 --- a/files/en-us/web/api/window/alert/index.md +++ b/files/en-us/web/api/window/alert/index.md @@ -38,7 +38,7 @@ alert("Hello world!"); Both produce: -![Black alert dialog box. At the top left small circle icon follow by white open and close brackets containing this white text: JavaScript application. Below on the left, a Hello world! white text. And on the bottom right a small blue button. The button's text is: ok in black.](alerthelloworld.png) +![Black alert dialog box. At the top left small circle icon follow by white open and close square brackets containing this white text: JavaScript application. Below on the left, a Hello world! white text. And on the bottom right a small blue button. The button's text is: ok in black.](alerthelloworld.png) ## Notes diff --git a/files/en-us/web/css/@import/index.md b/files/en-us/web/css/@import/index.md index b7c35f3fe34e959..5218a5e07ff2f60 100644 --- a/files/en-us/web/css/@import/index.md +++ b/files/en-us/web/css/@import/index.md @@ -108,7 +108,7 @@ The `@import` rules in the above examples show media-dependent conditions that w The `@import` rules above illustrate how you might import a layout that uses a grid if `display: grid` is supported, and otherwise imports CSS that uses `display: flex`. While you can only have one `supports()` statement, you can combine any number of feature checks with `not`, `and`, and `or`, as long as you wrap each condition to be tested in parentheses. You can also use parentheses to indicate precedence. -Note that if you just have a single declaration then you don't need to wrap it in additional brackets: this is shown in the first example above. +Note that if you just have a single declaration then you don't need to wrap it in additional parenthese: this is shown in the first example above. The examples above show support conditions using simple declaration syntax. You can also specify CSS functions in `supports()`, and it will evaluate to `true` if they are supported and can be evaluated on the user-agent. diff --git a/files/en-us/web/css/css_shapes/basic_shapes/index.md b/files/en-us/web/css/css_shapes/basic_shapes/index.md index 20dbf8610c4b512..5326b0c1193323f 100644 --- a/files/en-us/web/css/css_shapes/basic_shapes/index.md +++ b/files/en-us/web/css/css_shapes/basic_shapes/index.md @@ -15,7 +15,7 @@ Before looking at shapes, it is worth understanding two pieces of information th ## The \ type -The `` type is used as the value for all of our basic shapes. This type uses Functional Notation: the type of shape is followed by brackets, inside of which are additional values used to describe the shape. +The `` type is used as the value for all of our basic shapes. This type uses Functional Notation: the type of shape is followed by parenthese, inside of which are additional values used to describe the shape. The arguments which are accepted vary depending on the shape that you are creating. We will cover these in the examples below. diff --git a/files/en-us/web/css/round/index.md b/files/en-us/web/css/round/index.md index 7a03512f3ce81fe..a0a67e13ed1b271 100644 --- a/files/en-us/web/css/round/index.md +++ b/files/en-us/web/css/round/index.md @@ -83,7 +83,7 @@ The height of the boxes is therefore either rounded up to 125 px or down to 100 #### HTML The HTML defines 5 `div` elements that will be rendered as boxes by the CSS. -The elements contain text indicating the rounding strategy, initial value, and expected final height of the box (in brackets). +The elements contain text indicating the rounding strategy, initial value, and expected final height of the box (in parentheses). ```html
height: 100px
diff --git a/files/en-us/web/javascript/guide/control_flow_and_error_handling/index.md b/files/en-us/web/javascript/guide/control_flow_and_error_handling/index.md index 51ca8ab5a170849..3f0a5f938ae7979 100644 --- a/files/en-us/web/javascript/guide/control_flow_and_error_handling/index.md +++ b/files/en-us/web/javascript/guide/control_flow_and_error_handling/index.md @@ -22,7 +22,7 @@ for complete information about expressions. ## Block statement The most basic statement is a _block statement_, which is used to group -statements. The block is delimited by a pair of curly brackets: +statements. The block is delimited by a pair of curly braces: ```js { diff --git a/files/en-us/web/javascript/guide/functions/index.md b/files/en-us/web/javascript/guide/functions/index.md index 4c6c1c883f41a3a..9f14fc1890a7f59 100644 --- a/files/en-us/web/javascript/guide/functions/index.md +++ b/files/en-us/web/javascript/guide/functions/index.md @@ -18,7 +18,7 @@ A **function definition** (also called a **function declaration**, or **function - The name of the function. - A list of parameters to the function, enclosed in parentheses and separated by commas. -- The JavaScript statements that define the function, enclosed in curly brackets, `{ /* … */ }`. +- The JavaScript statements that define the function, enclosed in curly braces, `{ /* … */ }`. For example, the following code defines a simple function named `square`: diff --git a/files/en-us/web/javascript/guide/regular_expressions/assertions/index.md b/files/en-us/web/javascript/guide/regular_expressions/assertions/index.md index 00ae33dc6d1f427..9334a8b05aeeb6b 100644 --- a/files/en-us/web/javascript/guide/regular_expressions/assertions/index.md +++ b/files/en-us/web/javascript/guide/regular_expressions/assertions/index.md @@ -225,7 +225,7 @@ const fruits = ["Apple", "Watermelon", "Orange", "Avocado", "Strawberry"]; // In this example, two meanings of '^' control symbol are represented: // 1) Matching beginning of the input // 2) A negated or complemented character class: [^A] -// That is, it matches anything that is not enclosed in the brackets. +// That is, it matches anything that is not enclosed in the square brackets. const fruitsStartsWithNotA = fruits.filter((fruit) => /^[^A]/.test(fruit)); diff --git a/files/en-us/web/javascript/guide/regular_expressions/character_classes/index.md b/files/en-us/web/javascript/guide/regular_expressions/character_classes/index.md index 67553ac4afba7c8..4bcccba8b67f5dc 100644 --- a/files/en-us/web/javascript/guide/regular_expressions/character_classes/index.md +++ b/files/en-us/web/javascript/guide/regular_expressions/character_classes/index.md @@ -57,7 +57,7 @@ Character classes distinguish kinds of characters such as, for example, distingu

A negated or complemented character class. That is, it matches - anything that is not enclosed in the brackets. You can specify a range + anything that is not enclosed in the square brackets. You can specify a range of characters by using a hyphen, but if the hyphen appears as the first character after the ^ or the last character enclosed in the square brackets, it is taken as a literal hyphen to be included in the character class as a normal diff --git a/files/en-us/web/javascript/guide/regular_expressions/cheatsheet/index.md b/files/en-us/web/javascript/guide/regular_expressions/cheatsheet/index.md index 0a79b9dd0464321..257b103ac44dca7 100644 --- a/files/en-us/web/javascript/guide/regular_expressions/cheatsheet/index.md +++ b/files/en-us/web/javascript/guide/regular_expressions/cheatsheet/index.md @@ -58,7 +58,7 @@ This page provides an overall cheat sheet of all the capabilities of `RegExp` sy

A negated or complemented character class. That is, it matches - anything that is not enclosed in the brackets. You can specify a range + anything that is not enclosed in the square brackets. You can specify a range of characters by using a hyphen, but if the hyphen appears as the first or last character enclosed in the square brackets, it is taken as a literal hyphen to be included in the character class as a normal diff --git a/files/en-us/web/javascript/guide/text_formatting/index.md b/files/en-us/web/javascript/guide/text_formatting/index.md index d5f65c6f4af577d..cf884eed89ab1ca 100644 --- a/files/en-us/web/javascript/guide/text_formatting/index.md +++ b/files/en-us/web/javascript/guide/text_formatting/index.md @@ -82,7 +82,7 @@ hello[0] = "L"; // This has no effect, because strings are immutable hello[0]; // This returns "H" ``` -Characters whose Unicode scalar values are greater than U+FFFF (such as some rare Chinese/Japanese/Korean/Vietnamese characters and some emoji) are stored in UTF-16 with two surrogate code units each. For example, a string containing the single character U+1F600 "Emoji grinning face" will have length 2. Accessing the individual code units in such a string using brackets may have undesirable consequences such as the formation of strings with unmatched surrogate code units, in violation of the Unicode standard. (Examples should be added to this page after MDN bug 857438 is fixed.) See also {{jsxref("String.fromCodePoint()")}} or {{jsxref("String.prototype.codePointAt()")}}. +Characters whose Unicode scalar values are greater than U+FFFF (such as some rare Chinese/Japanese/Korean/Vietnamese characters and some emoji) are stored in UTF-16 with two surrogate code units each. For example, a string containing the single character U+1F600 "Emoji grinning face" will have length 2. Accessing the individual code units in such a string using square brackets may have undesirable consequences such as the formation of strings with unmatched surrogate code units, in violation of the Unicode standard. (Examples should be added to this page after MDN bug 857438 is fixed.) See also {{jsxref("String.fromCodePoint()")}} or {{jsxref("String.prototype.codePointAt()")}}. A `String` object has a variety of methods: for example those that return a variation on the string itself, such as `substring` and `toUpperCase`. diff --git a/files/en-us/web/javascript/language_overview/index.md b/files/en-us/web/javascript/language_overview/index.md index 3094b3d89f2a4b0..5285955e8058bcc 100644 --- a/files/en-us/web/javascript/language_overview/index.md +++ b/files/en-us/web/javascript/language_overview/index.md @@ -413,7 +413,7 @@ const obj = { }; ``` -Object properties can be [accessed](/en-US/docs/Web/JavaScript/Reference/Operators/Property_accessors) using dot (`.`) or brackets (`[]`). When using the dot notation, the key must be a valid [identifier](/en-US/docs/Web/JavaScript/Reference/Lexical_grammar#identifiers). Brackets, on the other hand, allow indexing the object with a dynamic key value. +Object properties can be [accessed](/en-US/docs/Web/JavaScript/Reference/Operators/Property_accessors) using dot (`.`) or square brackets (`[]`). When using the dot notation, the key must be a valid [identifier](/en-US/docs/Web/JavaScript/Reference/Lexical_grammar#identifiers). Square brackets, on the other hand, allow indexing the object with a dynamic key value. ```js // Dot notation diff --git a/files/en-us/web/javascript/reference/classes/index.md b/files/en-us/web/javascript/reference/classes/index.md index 867f6991b702fac..b79f9cf3fb83e10 100644 --- a/files/en-us/web/javascript/reference/classes/index.md +++ b/files/en-us/web/javascript/reference/classes/index.md @@ -47,7 +47,7 @@ Like function expressions, class expressions may be anonymous, or have a name th ### Class body -The body of a class is the part that is in curly brackets `{}`. This is where you define class members, such as methods or constructor. +The body of a class is the part that is in curly braces `{}`. This is where you define class members, such as methods or constructor. The body of a class is executed in [strict mode](/en-US/docs/Web/JavaScript/Reference/Strict_mode) even without the `"use strict"` directive. diff --git a/files/en-us/web/javascript/reference/errors/bad_return/index.md b/files/en-us/web/javascript/reference/errors/bad_return/index.md index 9a6ab6887b6ee02..348bfbc5d5c093e 100644 --- a/files/en-us/web/javascript/reference/errors/bad_return/index.md +++ b/files/en-us/web/javascript/reference/errors/bad_return/index.md @@ -22,11 +22,11 @@ SyntaxError: Return statements are only valid inside functions. (Safari) ## What went wrong? -A [`return`](/en-US/docs/Web/JavaScript/Reference/Statements/return) statement is called outside of a [function](/en-US/docs/Web/JavaScript/Guide/Functions). Maybe there are missing curly brackets somewhere? The `return` statement must be in a function, because it ends function execution and specifies a value to be returned to the function caller. +A [`return`](/en-US/docs/Web/JavaScript/Reference/Statements/return) statement is called outside of a [function](/en-US/docs/Web/JavaScript/Guide/Functions). Maybe there are missing curly braces somewhere? The `return` statement must be in a function, because it ends function execution and specifies a value to be returned to the function caller. ## Examples -### Missing curly brackets +### Missing curly braces ```js-nolint example-bad function cheer(score) { @@ -41,7 +41,7 @@ function cheer(score) { // SyntaxError: return not in function ``` -The curly brackets look correct at a first glance, but this code snippet is missing a `{` after the first `if` statement. Correct would be: +The curly braces look correct at a first glance, but this code snippet is missing a `{` after the first `if` statement. Correct would be: ```js example-good function cheer(score) { diff --git a/files/en-us/web/javascript/reference/errors/missing_bracket_after_list/index.md b/files/en-us/web/javascript/reference/errors/missing_bracket_after_list/index.md index 4091a54d12bd36d..876dfc3dc4e775b 100644 --- a/files/en-us/web/javascript/reference/errors/missing_bracket_after_list/index.md +++ b/files/en-us/web/javascript/reference/errors/missing_bracket_after_list/index.md @@ -7,7 +7,7 @@ page-type: javascript-error {{jsSidebar("Errors")}} The JavaScript exception "missing ] after element list" occurs when there is an error -with the array initializer syntax somewhere. Likely there is a closing bracket +with the array initializer syntax somewhere. Likely there is a closing square bracket (`]`) or a comma (`,`) missing. ## Message @@ -24,7 +24,7 @@ SyntaxError: Unexpected token ';'. Expected either a closing ']' or a ',' follow ## What went wrong? There is an error with the array initializer syntax somewhere. Likely there is a -closing bracket (`]`) or a comma (`,`) missing. +closing square bracket (`]`) or a comma (`,`) missing. ## Examples diff --git a/files/en-us/web/javascript/reference/errors/missing_colon_after_property_id/index.md b/files/en-us/web/javascript/reference/errors/missing_colon_after_property_id/index.md index e503970933cf2d7..5e35da4d0d719c3 100644 --- a/files/en-us/web/javascript/reference/errors/missing_colon_after_property_id/index.md +++ b/files/en-us/web/javascript/reference/errors/missing_colon_after_property_id/index.md @@ -69,7 +69,7 @@ const obj = { "b"+"ar": "foo" }; // SyntaxError: missing : after property id ``` -Put the expression in brackets `[]`: +Put the expression in square brackets `[]`: ```js example-good const obj = { ["b" + "ar"]: "foo" }; diff --git a/files/en-us/web/javascript/reference/errors/missing_curly_after_function_body/index.md b/files/en-us/web/javascript/reference/errors/missing_curly_after_function_body/index.md index b4d2c3d94d240ca..4f7800dcc4f2cec 100644 --- a/files/en-us/web/javascript/reference/errors/missing_curly_after_function_body/index.md +++ b/files/en-us/web/javascript/reference/errors/missing_curly_after_function_body/index.md @@ -7,7 +7,7 @@ page-type: javascript-error {{jsSidebar("Errors")}} The JavaScript exception "missing } after function body" occurs when there is a syntax -mistake when creating a function somewhere. Check if any closing curly brackets or +mistake when creating a function somewhere. Check if any closing curly braces or parenthesis are in the correct order. ## Message @@ -23,7 +23,7 @@ SyntaxError: missing } after function body (Firefox) ## What went wrong? There is a syntax mistake when creating a function somewhere. Also check if any closing -curly brackets or parenthesis are in the correct order. Indenting or formatting the code +curly braces or parenthesis are in the correct order. Indenting or formatting the code a bit nicer might also help you to see through the jungle. ## Examples @@ -54,7 +54,7 @@ function charge() { ``` It can be more obscure when using [IIFEs](/en-US/docs/Glossary/IIFE) or other constructs that use -a lot of different parenthesis and curly brackets, for example. +a lot of different parenthesis and curly braces, for example. ```js-nolint example-bad (function () { diff --git a/files/en-us/web/javascript/reference/errors/missing_curly_after_property_list/index.md b/files/en-us/web/javascript/reference/errors/missing_curly_after_property_list/index.md index 54077f4271a81d1..1a5029863226924 100644 --- a/files/en-us/web/javascript/reference/errors/missing_curly_after_property_list/index.md +++ b/files/en-us/web/javascript/reference/errors/missing_curly_after_property_list/index.md @@ -25,7 +25,7 @@ SyntaxError: Unexpected identifier 'c'. Expected '}' to end an object literal. ( There is a mistake in the [object initializer](/en-US/docs/Web/JavaScript/Reference/Operators/Object_initializer) syntax somewhere. Might be in fact a missing curly bracket, but could -also be a missing comma, for example. Also check if any closing curly brackets or +also be a missing comma, for example. Also check if any closing curly braces or parenthesis are in the correct order. Indenting or formatting the code a bit nicer might also help you to see through the jungle. diff --git a/files/en-us/web/javascript/reference/errors/not_a_function/index.md b/files/en-us/web/javascript/reference/errors/not_a_function/index.md index 8fca13d6a0cbfb4..87fa46167e2b6a2 100644 --- a/files/en-us/web/javascript/reference/errors/not_a_function/index.md +++ b/files/en-us/web/javascript/reference/errors/not_a_function/index.md @@ -126,7 +126,7 @@ const myNewDog = new Dog(); myNewDog.name("Cassidy"); //Dog { age: 11, color: 'black', dogName: 'Cassidy' } ``` -### Using brackets for multiplication +### Using parenthese for multiplication In math, you can write 2 × (3 + 5) as 2\*(3 + 5) or just 2(3 + 5). diff --git a/files/en-us/web/javascript/reference/errors/unexpected_token/index.md b/files/en-us/web/javascript/reference/errors/unexpected_token/index.md index b9d7bbe99b2be06..0c0287e09cca3fe 100644 --- a/files/en-us/web/javascript/reference/errors/unexpected_token/index.md +++ b/files/en-us/web/javascript/reference/errors/unexpected_token/index.md @@ -50,13 +50,13 @@ for (let i = 0; i < 5; ++i) { } ``` -### Not enough brackets +### Not enough parenthese -Sometimes, you leave out brackets around `if` statements: +Sometimes, you leave out parenthese around `if` statements: ```js-nolint example-bad function round(n, upperBound, lowerBound) { - if (n > upperBound) || (n < lowerBound) { // Not enough brackets here! + if (n > upperBound) || (n < lowerBound) { // Not enough parenthese here! throw new Error(`Number ${n} is more than ${upperBound} or less than ${lowerBound}`); } else if (n < (upperBound + lowerBound) / 2) { return lowerBound; @@ -66,8 +66,8 @@ function round(n, upperBound, lowerBound) { } // SyntaxError: expected expression, got '||' ``` -The brackets may look correct at first, but note how the `||` is outside the -brackets. Correct would be putting brackets around the `||`: +The parenthese may look correct at first, but note how the `||` is outside the +parenthese. Correct would be putting parenthese around the `||`: ```js-nolint example-good function round(n, upperBound, lowerBound) { diff --git a/files/en-us/web/javascript/reference/errors/unnamed_function_statement/index.md b/files/en-us/web/javascript/reference/errors/unnamed_function_statement/index.md index feefcff95f34734..936d66c8a7833b8 100644 --- a/files/en-us/web/javascript/reference/errors/unnamed_function_statement/index.md +++ b/files/en-us/web/javascript/reference/errors/unnamed_function_statement/index.md @@ -106,7 +106,7 @@ const greeter = { ### Callback syntax Also, check your syntax when using callbacks. -Brackets and commas can quickly get confusing. +Braces and commas can quickly get confusing. ```js-nolint example-bad promise.then( diff --git a/files/en-us/web/javascript/reference/functions/arrow_functions/index.md b/files/en-us/web/javascript/reference/functions/arrow_functions/index.md index 29d2d27b5dfb272..bc46dd117fbc75d 100644 --- a/files/en-us/web/javascript/reference/functions/arrow_functions/index.md +++ b/files/en-us/web/javascript/reference/functions/arrow_functions/index.md @@ -69,7 +69,7 @@ Let's decompose a traditional anonymous function down to the simplest arrow func return a + 100; }); -// 1. Remove the word "function" and place arrow between the argument and opening body bracket +// 1. Remove the word "function" and place arrow between the argument and opening body brace (a) => { return a + 100; }; diff --git a/files/en-us/web/javascript/reference/functions/index.md b/files/en-us/web/javascript/reference/functions/index.md index ef7a4c1c93a4edf..928da37ac14541f 100644 --- a/files/en-us/web/javascript/reference/functions/index.md +++ b/files/en-us/web/javascript/reference/functions/index.md @@ -37,7 +37,7 @@ function formatNumber(num) { formatNumber(2); ``` -In this example, the `num` variable is called the function's _parameter_: it's declared in the bracket-enclosed list of the function's definition. The function expects the `num` parameter to be a number — although this is not enforceable in JavaScript without writing runtime validation code. In the `formatNumber(2)` call, the number `2` is the function's _argument_: it's the value that is actually passed to the function in the function call. The argument value can be accessed inside the function body through the corresponding parameter name or the [`arguments`](/en-US/docs/Web/JavaScript/Reference/Functions/arguments) object. +In this example, the `num` variable is called the function's _parameter_: it's declared in the parenthesis-enclosed list of the function's definition. The function expects the `num` parameter to be a number — although this is not enforceable in JavaScript without writing runtime validation code. In the `formatNumber(2)` call, the number `2` is the function's _argument_: it's the value that is actually passed to the function in the function call. The argument value can be accessed inside the function body through the corresponding parameter name or the [`arguments`](/en-US/docs/Web/JavaScript/Reference/Functions/arguments) object. Arguments are always [_passed by value_](https://en.wikipedia.org/wiki/Evaluation_strategy#Call_by_reference) and never _passed by reference_. This means that if a function reassigns a parameter, the value won't change outside the function. More precisely, object arguments are [_passed by sharing_](https://en.wikipedia.org/wiki/Evaluation_strategy#Call_by_sharing), which means if the object's properties are mutated, the change will impact the outside of the function. For example: @@ -362,7 +362,7 @@ if (typeof window.noFunc === "function") { } ``` -Note that in the `if` test, a reference to `noFunc` is used — there are no brackets `()` after the function name so the actual function is not called. +Note that in the `if` test, a reference to `noFunc` is used — there are no parentheses `()` after the function name so the actual function is not called. ## Specifications diff --git a/files/en-us/web/javascript/reference/global_objects/array/array/index.md b/files/en-us/web/javascript/reference/global_objects/array/array/index.md index 654a2874103e486..0a8860ea73eb072 100644 --- a/files/en-us/web/javascript/reference/global_objects/array/array/index.md +++ b/files/en-us/web/javascript/reference/global_objects/array/array/index.md @@ -34,7 +34,7 @@ Array(arrayLength) a single argument is passed to the `Array` constructor and that argument is a number (see the `arrayLength` parameter below). Note that this special case only applies to JavaScript arrays created with the `Array` constructor, not - array literals created with the bracket syntax. + array literals created with the square bracket syntax. - `arrayLength` - : If the only argument passed to the `Array` constructor is an integer between 0 and 232 - 1 (inclusive), this returns a new JavaScript array with diff --git a/files/en-us/web/javascript/reference/operators/destructuring_assignment/index.md b/files/en-us/web/javascript/reference/operators/destructuring_assignment/index.md index c0b47349b7fa8c3..bed91b5b6219c5a 100644 --- a/files/en-us/web/javascript/reference/operators/destructuring_assignment/index.md +++ b/files/en-us/web/javascript/reference/operators/destructuring_assignment/index.md @@ -38,7 +38,7 @@ let a, b, a1, b1, c, d, rest, pop, push; [a, b, ...{ pop, push }] = array; [a, b, ...[c, d]] = array; -({ a, b } = obj); // brackets are required +({ a, b } = obj); // parentheses are required ({ a: a1, b: b1 } = obj); ({ a: a1 = aDefault, b = bDefault } = obj); ({ a, b, ...rest } = obj); diff --git a/files/en-us/web/javascript/reference/operators/object_initializer/index.md b/files/en-us/web/javascript/reference/operators/object_initializer/index.md index ffdaacb13256d8f..a8d535681e5d0a4 100644 --- a/files/en-us/web/javascript/reference/operators/object_initializer/index.md +++ b/files/en-us/web/javascript/reference/operators/object_initializer/index.md @@ -179,7 +179,7 @@ For more information and examples about methods, see [method definitions](/en-US ### Computed property names -The object initializer syntax also supports computed property names. That allows you to put an expression in brackets `[]`, that will be computed and used as the property name. This is reminiscent of the bracket notation of the [property accessor](/en-US/docs/Web/JavaScript/Reference/Operators/Property_accessors) syntax, which you may have used to read and set properties already. +The object initializer syntax also supports computed property names. That allows you to put an expression in square brackets `[]`, that will be computed and used as the property name. This is reminiscent of the bracket notation of the [property accessor](/en-US/docs/Web/JavaScript/Reference/Operators/Property_accessors) syntax, which you may have used to read and set properties already. Now you can use a similar syntax in object literals, too: diff --git a/files/en-us/web/javascript/reference/operators/optional_chaining/index.md b/files/en-us/web/javascript/reference/operators/optional_chaining/index.md index c13acdf39386cdf..cc999497f05a360 100644 --- a/files/en-us/web/javascript/reference/operators/optional_chaining/index.md +++ b/files/en-us/web/javascript/reference/operators/optional_chaining/index.md @@ -103,7 +103,7 @@ You can also use the optional chaining operator with [bracket notation](/en-US/d const nestedProp = obj?.["prop" + "Name"]; ``` -This is particularly useful for arrays, since array indices must be accessed with brackets. +This is particularly useful for arrays, since array indices must be accessed with square brackets. ```js function printMagicIndex(arr) { diff --git a/files/en-us/web/javascript/reference/statements/block/index.md b/files/en-us/web/javascript/reference/statements/block/index.md index d388c6d855a1bfe..a232c518f43382f 100644 --- a/files/en-us/web/javascript/reference/statements/block/index.md +++ b/files/en-us/web/javascript/reference/statements/block/index.md @@ -7,7 +7,7 @@ browser-compat: javascript.statements.block {{jsSidebar("Statements")}} -A **block statement** is used to group zero or more statements. The block is delimited by a pair of braces ("curly brackets") and contains a list of zero or more statements and declarations. +A **block statement** is used to group zero or more statements. The block is delimited by a pair of braces ("curly braces") and contains a list of zero or more statements and declarations. {{EmbedInteractiveExample("pages/js/statement-block.html", "taller")}} diff --git a/files/en-us/web/javascript/reference/statements/index.md b/files/en-us/web/javascript/reference/statements/index.md index 3d5faf2adf53525..a0835c9eeaae035 100644 --- a/files/en-us/web/javascript/reference/statements/index.md +++ b/files/en-us/web/javascript/reference/statements/index.md @@ -72,7 +72,7 @@ For an alphabetical listing see the sidebar on the left. - {{jsxref("Statements/Empty", "Empty", "", 1)}} - : An empty statement is used to provide no statement, although the JavaScript syntax would expect one. - {{jsxref("Statements/block", "Block", "", 1)}} - - : A block statement is used to group zero or more statements. The block is delimited by a pair of curly brackets. + - : A block statement is used to group zero or more statements. The block is delimited by a pair of curly braces. - {{jsxref("Statements/Expression_statement", "Expression statement", "", 1)}} - : An expression statement evaluates an expression and discards its result. It allows the expression to perform side effects, such as executing a function or updating a variable. - {{jsxref("Statements/debugger", "debugger")}} diff --git a/files/en-us/web/mathml/element/mfenced/index.md b/files/en-us/web/mathml/element/mfenced/index.md index 33d11bfc1448456..0158bef59e48d00 100644 --- a/files/en-us/web/mathml/element/mfenced/index.md +++ b/files/en-us/web/mathml/element/mfenced/index.md @@ -10,7 +10,7 @@ browser-compat: mathml.elements.mfenced {{MathMLRef}}{{Deprecated_Header}}{{Non-standard_Header}} -The **``** [MathML](/en-US/docs/Web/MathML) element provides the possibility to add custom opening and closing parentheses (such as brackets) and separators (such as commas or semicolons) to an expression. +The **``** [MathML](/en-US/docs/Web/MathML) element provides the possibility to add custom opening and closing brackets (such as parenthese) and separators (such as commas or semicolons) to an expression. > **Note:** Historically, the `` element was defined as a shorthand for writing fenced expressions and equivalent to an expanded form involving {{MathMLElement("mrow")}} and {{MathMLElement("mo")}} elements. Nowadays, it is recommended to use that equivalent form instead. diff --git a/files/en-us/web/xslt/element/index.md b/files/en-us/web/xslt/element/index.md index cac7a5193cc7c6b..43c594bacdd105d 100644 --- a/files/en-us/web/xslt/element/index.md +++ b/files/en-us/web/xslt/element/index.md @@ -14,7 +14,7 @@ On a related note, any attribute in an LRE and some attributes of a limited numb /images ``` -The expression to be evaluated is placed inside curly brackets: +The expression to be evaluated is placed inside curly braces: ```xml