Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion files/en-us/web/api/sharedworker/sharedworker/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ new SharedWorker(url, options)

The **`SharedWorker()`** constructor creates a {{domxref("SharedWorker")}} object that executes the classic script or module at the specified URL.

The script must be [same-origin](/en-US/docs/Web/Security/Same-origin_policy) with the associated document, but may itself import scripts or modules that are cross-origin (if permitted by CORS and other restrictions).
The script must be [same-origin](/en-US/docs/Web/Security/Defenses/Same-origin_policy) with the associated document, but may itself import scripts or modules that are cross-origin (if permitted by CORS and other restrictions).
If a cross-origin worker is required, users must load it from an intermediate same-origin worker or a blob.

For more information see [Description](/en-US/docs/Web/API/Worker/Worker#description) in the `Worker()` constructor.
Expand Down
2 changes: 1 addition & 1 deletion files/en-us/web/api/worker/worker/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ new Worker(url, options)

The **`Worker()`** constructor creates a {{domxref("Worker")}} object that executes the classic script or module at the specified URL.

The script must be [same-origin](/en-US/docs/Web/Security/Same-origin_policy) with the associated document, but may itself import scripts or modules that are cross-origin (if permitted by CORS and other restrictions).
The script must be [same-origin](/en-US/docs/Web/Security/Defenses/Same-origin_policy) with the associated document, but may itself import scripts or modules that are cross-origin (if permitted by CORS and other restrictions).
If a cross-origin worker is required, users must load it from an intermediate same-origin worker or a blob.

### Module and classic workers
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ const b = 2;
() => a + b + 100;
```

The braces can only be omitted if the function directly returns an expression. If the body has statements, the braces are required — and so is the `return` keyword. Arrow functions cannot guess what or when you want to return.
The braces can only be omitted if the function directly returns an expression. If the body has statements, the braces are required. In this case, return values must be explicitly specified with the `return` keyword. Arrow functions cannot guess what or when you want to return.

```js
// Traditional anonymous function
Expand Down Expand Up @@ -145,16 +145,23 @@ const bob2 = (a) => a + 100;

Arrow functions can have either an _expression body_ or the usual _block body_.

In an expression body, only a single expression is specified, which becomes the implicit return value. In a block body, you must use an explicit `return` statement.
In an expression body, only a single expression is specified, which becomes the implicit return value. The block body is analogous to traditional function bodies, where return values must be explicitly specified with the `return` keyword. Arrow functions are not required to return a value. If execution of the block body reaches the end without encountering a `return` statement, the function returns `undefined` like other functions.

```js
const func = (x) => x * x;
// expression body syntax, implied "return"
// Expression body
const add = (a, b) => a + b; // Implicitly returns a

const func2 = (x, y) => {
return x + y;
// Block body
const add2 = (a, b) => {
console.log(a, b);
return a + b; // Must explicitly return a value
};

// No return value
const add3 = (b) => {
a += b;
// No return statement, so returns undefined
};
// with block body, explicit "return" needed
```

Returning object literals using the expression body syntax `(params) => { object: literal }` does not work as expected.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ Intl.DateTimeFormat(locales, options)
- `"short"`
- : E.g., `Thu`
- `"narrow"`
- : E.g., `T`. Two weekdays may have the same narrow style for some locales (e.g., `Tuesday`'s narrow style is also `T`).
- : E.g., `T`. Two weekdays may have the same narrow style for some locales (e.g., both `Tuesday`'s and `Thursday`'s narrow styles are `T` in the `en-US` locale).
- `era`
- : The representation of the era. Possible values are:
- `"long"`
Expand All @@ -113,7 +113,7 @@ Intl.DateTimeFormat(locales, options)
- `"short"`
- : E.g., `Mar`
- `"narrow"`
- : E.g., `M`). Two months may have the same narrow style for some locales (e.g., `May`'s narrow style is also `M`).
- : E.g., `M`. Two months may have the same narrow style for some locales (e.g., both `March`'s and `May`'s narrow styles are `M` in the `en-US` locale).
- `day`
- : The representation of the day. Possible values are `"numeric"` and `"2-digit"`.
- `dayPeriod`
Expand Down
2 changes: 1 addition & 1 deletion files/jsondata/L10n-CSS.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"en-US": "At-Rules",
"es": "Reglas",
"fr": "Règles @",
"ja": "アット規則",
"ja": "アットルール",
"ko": "@규칙",
"pt-BR": "Regras @",
"ru": "@-правила",
Expand Down
12 changes: 11 additions & 1 deletion files/sidebars/cssref.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -464,24 +464,31 @@ l10n:
Animations: アニメーション
Backgrounds_and_Borders: 背景と境界
Box alignment: ボックス配置
Box sizing: ボックスサイズ指定
Box_model: ボックスモデル
Cascade: カスケード
Cascading variables: カスケード変数
Colors: 色
Color_contrast: "アクセシビリティ: 色のコントラスト"
Columns: 段組み
Combinators: 結合子
Conditional_rules: 条件付きルール
Containment: コンテナー
Coordinate_systems: 座標系 (API)
CSSOM_view: CSSOM view
Custom_functions_and_mixins: カスタム関数とミックスイン
Display: 表示方法
Environment_variables: 環境変数
Filter_effects: フィルター効果
Flexbox: フレックスボックス
Fonts: フォント
Functions: 関数
Grid: グリッド
Images: 画像
Layout cookbook: レイアウト料理帳
Lists_and_counters: リストとカウンター
Logical_properties: 論理的プロパティ
Masking: マスク
Media_queries: メディアクエリー
Modules: モジュール
Nesting: 入れ子のスタイルルール
Expand All @@ -490,7 +497,8 @@ l10n:
Properties: プロパティ
Pseudo-classes: 擬似クラス
Pseudo-elements: 擬似要素
Scroll_anchoring: スクロールアンカリング
Scroll_anchoring: スクロール固定
Scroll-driven_animations: スクロール駆動アニメーション
Scroll_snap: スクロールスナップ
Selectors: セレクター
Shapes: シェイプ
Expand All @@ -501,7 +509,9 @@ l10n:
Transitions: トランジション
Tools: ツール
Types: データ型
Values: 値
Values and units: 値と単位
Writing modes: 書字方向
ko:
Guides: 안내서
Animations: 애니메이션
Expand Down
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.