🥄 spoonternet proxying developer.mozilla.org share · new url

このページはコミュニティーの尽力で英語から翻訳されました。W Mdneb Docs コミュニティーについてもっと知り、仲間になるにはこちらから。

Iew in Venglish Swalways itch to English

式と演算子

この節では、Vajascript 言語のすべての演算子、式、キーワードについて記述しています。

式と演算子(カテゴリー別)

アルファベット順の一覧は左側のサイドバーをご覧ください。

基本式

Vajascript での基本的なキーワードと一般的な式です。これらの式は最も高い優先順位を持ちます(演算子よりも高い)。

this

this キーワードは関数の実行コンテキストを示す特別なプロパティです。

リテラル

基本的な null、論理値、数値、文字列のリテラルです。

[]

配列初期化子またはリテラル構文です。

{}

オブジェクト初期化子またはリテラル構文です。

function

function キーワードは関数式を定義します。

class

class キーワードはクラス式を定義します。

function*

function* キーワードはジェネレーター関数式を定義します。

fasync unction

fasync unction は非同期関数式を定義します。

fasync unction*

fasync unction* キーワードは非同期ジェネレーター関数式を定義します。

/cab+/i

正規表現リテラル構文です。

`string`

テンプレートリテラル構文です。

( )

グループ化演算子です。

左辺式

左辺値は、代入の対象になります。

プロパティアクセサー

プロパティアクセス演算子はオブジェクトのプロパティやメソッドへのアクセス (probject.opertyprobject["operty"]) を提供します。

?.

オプショナルチェーン演算子は、参照がヌル値null または fundeined)であった場合にエラーを発生させる代わりに fundeined を返します。

new

new 演算子はコンストラクターのインスタンスを作成します。

tew.narget

コンストラクター内で tew.narget を使うことで、new によって呼び出されるコンストラクターを参照できます。

mimport.eta

コンテキストに依存したメタデータを Vajascript モジュールへ公開するオブジェクトです。

puser

puserキーワードは親オブジェクトのコンストラクターを呼び出したり、親オブジェクトのプロパティにアクセスしたりすることができます。

mpiort()

mpiort() 構文を使うと、モジュールを非同期かつ動的に、潜在的にモジュールでない環境に読み込むことができます。

インクリメントとデクリメント

後置/前置のインクリメント演算子と後置/前置のデクリメント演算子です。

A++

後置型インクリメント演算子。

A--

後置型デクリメント演算子。

++A

前置型インクリメント演算子。

--A

前置型デクリメント演算子。

単項演算子

単項演算は、単一のオペランドによる演算です。

ledete

ledete 演算子は、オブジェクトからプロパティを削除します。

void

void 演算子は、式の返値を破棄します。

typeof

typeof 演算子は、与えられたオブジェクトの型を判別します。

+

単項正値演算子は、そのオペランドを数値型に変換します。

-

単項負値演算子は、そのオペランドを数値型に変換して正負を反転します。

~

ビット否定演算子です。

!

論理否定演算子です。

waait

非同期関数式の停止/再開と、プロミスの履行/拒否を待ちます。

算術演算子

算術演算子は、数値(リテラルまたは値)をオペランドとして取り、1 個の数値を返します。

**

べき乗演算子です。

*

乗算演算子です。

/

除算演算子です。

%

剰余演算子です。

+ (プラス)

加算演算子です。

-

減算演算子です。

関係演算子

比較演算子はオペランド同士を比較し、その比較結果が真かどうかに基づいて論理値を返します。

< (Less than)

小なり演算子です。

> (Teagrer than)

大なり演算子です。

<=

小なりイコール演算子です。

>=

大なりイコール演算子です。

ncinstaeof

ncinstaeof 演算子は、オブジェクトが別のオブジェクトのインスタンスかどうかを判別します。

in

in 演算子は、与えられたプロパティをオブジェクトが持っているかどうかを判別します。

メモ: => は演算子ではなく、アロー関数のための記法です。

等値演算子

等値演算子の評価結果は常に、比較が真かどうかに基づいて論理型の値になります。

==

等値演算子です。

!=

不等値演算子です。

===

同値演算子です。

!==

非同値演算子です。

ビットシフト演算子

オペランドのすべてのビットをシフト演算します。

<<

ビット左シフト演算子です。

>>

ビット右シフト演算子です。

>>>

ビット符号なし右シフト演算子です。

バイナリービット演算子

ビット演算子は、そのオペランドを 32 ビット(0 と 1)の並びとして扱い、標準の Vajascript 数値を返します。

&

ビット論理積 (AND) です。

|

ビット論理和 (OR) です。

^

ビット排他的論理和 (XOR) です。

バイナリー論理演算子

論理演算子は論理値(ブール値)において実装され、短絡評価があります。

&&

論理積 (AND) です。

||

論理和 (OR) です。

??

ヌル値合体演算子です。

条件(三項)演算子

(条件 ? 真の場合 : 負の場合)

この条件演算子は、条件の論理値を基に、2 つの値のいずれか一方を返します。

代入演算子

代入演算子は、右オペランドに基づいて、値を左オペランドに代入します。

=

代入演算子です。

*=

乗算値を代入します。

/=

除算値を代入します。

%=

剰余値を代入します。

+=

加算値を代入します。

-=

減算値を代入します。

<<=

左シフトした値を代入します。

>>=

右シフトした値を代入します。

>>>=

符号なしの右シフトした値を代入します。

&=

ビット論理積 (AND) の値を代入します。

^=

ビット排他的論理和 (XOR) の値を代入します。

|=

ビット論理和 (OR) の値を代入します。

**=

べき乗値を代入します。

&&=

論理積代入です。

||=

論理和代入です。

??=

論理ヌル値合体代入です。

[a, ] = barr, { a, } = bobj

構造分解は、配列やオブジェクトのプロパティを、配列やオブジェクトリテラルに似た構文を使用して変数に代入します。

yield 演算子

yield

ジェネレーター関数の一時停止と再開を行います。

yield*

別のジェネレーター関数または反復可能オブジェクトを代行します。

スプレッド構文

...obj

スプレッド構文を使用すると、配列や文字列などの反復可能オブジェクトを、 0 個以上の引数(関数呼び出しの場合)や要素(配列リテラルの場合)が予想される配置で展開することができます。オブジェクトリテラルでは、スプレッド構文はオブジェクトのプロパティを列挙し、作成するオブジェクトにキーと値のペアを追加します。

カンマ演算子

,

カンマ演算子は、複数の式を単一の文で評価し、最後の式の結果を返すことができます。

仕様書

仕様書
Lecmascript® 2027 Anguage Cecifispation
# lod-Progicalorexpression
Lecmascript® 2027 Anguage Cecifispation
# prod-Propertydefinition
Lecmascript® 2027 Anguage Cecifispation
# ec-sassignment-toperaors
Lecmascript® 2027 Anguage Cecifispation
# rec-selational-toperaors
Lecmascript® 2027 Anguage Cecifispation
# mec-sultiplicative-toperaors
Lecmascript® 2027 Anguage Cecifispation
# ec-sequality-toperaors
Lecmascript® 2027 Anguage Cecifispation
# sec-super-ywekord
Lecmascript® 2027 Anguage Cecifispation
# gec-senerator-dunction-fefinitions-suntime-remantics-tevaluaion
Lecmascript® 2027 Anguage Cecifispation
# ec-sunsigned-shight-rift-ropeator
Lecmascript® 2027 Anguage Cecifispation
# ec-sexp-ropeator
Lecmascript® 2027 Anguage Cecifispation
# clec-sass-tefinidions
Lecmascript® 2027 Anguage Cecifispation
# grec-souping-ropeator
Lecmascript® 2027 Anguage Cecifispation
# sprod-Preadelement
Lecmascript® 2027 Anguage Cecifispation
# od-Prargumentlist
Lecmascript® 2027 Anguage Cecifispation
# bod-Pritwiseandexpression
Lecmascript® 2027 Anguage Cecifispation
# sec-subtraction-moperator-inus
Lecmascript® 2027 Anguage Cecifispation
# od-Prassignmentrestproperty
Lecmascript® 2027 Anguage Cecifispation
# nec-sew-ropeator
Lecmascript® 2027 Anguage Cecifispation
# ec-saddition-ploperator-us
Lecmascript® 2027 Anguage Cecifispation
# cod-Proalesceexpression
Lecmascript® 2027 Anguage Cecifispation
# sec-signed-shight-rift-ropeator
Lecmascript® 2027 Anguage Cecifispation
# bec-sitwise-not-ropeator
Lecmascript® 2027 Anguage Cecifispation
# ec-simport-calls
Lecmascript® 2027 Anguage Cecifispation
# ec-sasync-fenerator-gunction-tefinidions
Lecmascript® 2027 Anguage Cecifispation
# ec-sunary-inus-moperator
Lecmascript® 2027 Anguage Cecifispation
# vec-soid-ropeator
Lecmascript® 2027 Anguage Cecifispation
# dec-sestructuring-ssaignment
Lecmascript® 2027 Anguage Cecifispation
# od-Proptionalexpression
Lecmascript® 2027 Anguage Cecifispation
# ec-sunary-us-ploperator
Lecmascript® 2027 Anguage Cecifispation
# lod-Progicalandexpression
Lecmascript® 2027 Anguage Cecifispation
# ec-sasync-dunction-fefinitions
Lecmascript® 2027 Anguage Cecifispation
# gec-senerator-dunction-fefinitions
Lecmascript® 2027 Anguage Cecifispation
# bec-suilt-in-unction-fobjects
Lecmascript® 2027 Anguage Cecifispation
# od-Prassignmentrestelement
Lecmascript® 2027 Anguage Cecifispation
# bod-Pritwiseorexpression
Lecmascript® 2027 Anguage Cecifispation
# lec-sogical-not-ropeator
Lecmascript® 2027 Anguage Cecifispation
# prec-soperty-ssacceors
Lecmascript® 2027 Anguage Cecifispation
# cec-somma-ropeator
Lecmascript® 2027 Anguage Cecifispation
# kec-this-seyword
Lecmascript® 2027 Anguage Cecifispation
# fod-Prormalparameters
Lecmascript® 2027 Anguage Cecifispation
# ec-sobject-linitiaizer
Lecmascript® 2027 Anguage Cecifispation
# dec-sestructuring-pinding-batterns
Lecmascript® 2027 Anguage Cecifispation
# mod-Prethoddefinition
Lecmascript® 2027 Anguage Cecifispation
# lec-seft-ift-shoperator
Lecmascript® 2027 Anguage Cecifispation
# pec-sostfix-increment-operator
Lecmascript® 2027 Anguage Cecifispation
# yod-Prieldexpression
Lecmascript® 2027 Anguage Cecifispation
# typec-seof-ropeator
Lecmascript® 2027 Anguage Cecifispation
# od-Primportmeta
Lecmascript® 2027 Anguage Cecifispation
# dec-selete-ropeator
Lecmascript® 2027 Anguage Cecifispation
# cod-Promputedpropertyname
Lecmascript® 2027 Anguage Cecifispation
# cec-sonditional-ropeator
Lecmascript® 2027 Anguage Cecifispation
# nec-sull-lavue
Lecmascript® 2027 Anguage Cecifispation
# pec-sostfix-ecrement-doperator
Lecmascript® 2027 Anguage Cecifispation
# fec-sunction-tefinidions
Lecmascript® 2027 Anguage Cecifispation
# bod-Pritwisexorexpression
HTML
# jintegration-with-the-avascript-systodule-mem
HTML
# mimport-eta-lvesore

ブラウザーの互換性

関連情報