Core Concepts

Expression types

Quick reference of the expression types you can use in rs-x expressions.

What this page covers

This table lists the supported expression node kinds, grouped by category.

It focuses on user-facing expression types you can use directly in expressions.

How to use this page

Use this page as a quick reference while writing or debugging an expression.

If a result looks wrong, identify the node type first and then check that part of the expression.

Optional chaining (?.) is supported. It is not required in rs-x member-path evaluation, because member path evaluation already handles null and undefined safely.

Supported expression types

AdditionArithmetica + bAdds numeric values, or concatenates when one side is a string.
AndLogicalisReady && isValidLogical AND with short-circuit behavior (returns first falsy operand).
ArrayLiteral / structure[a, b, c]Array literal node.
BigIntLiteral10nBigInt literal node.
BitwiseAndBitwisea & bBitwise AND.
BitwiseLeftShiftBitwisevalue << 1Left bit-shift.
BitwiseNotBitwise~valueBitwise NOT.
BitwiseOrBitwisea | bBitwise OR.
BitwiseRightShiftBitwisevalue >> 1Right bit-shift (sign-preserving).
BitwiseUnsignedRightShiftBitwisevalue >>> 1Unsigned right bit-shift (zero-fill).
BitwiseXorBitwisea ^ bBitwise XOR.
BooleanLiteraltrueBoolean literal node.
ConditionalLogicala > 0 ? a : 0Ternary conditional expression.
DivisionArithmetica / bNumeric division.
EqualityComparisona == bLoose equality check (with coercion).
ExponentiationArithmetica ** 2Power operator.
FunctionCall / constructionsum(a, b)Function call expression node.
GreaterThanComparisona > bGreater-than comparison.
GreaterThanOrEqualComparisona >= bGreater-than-or-equal comparison.
IdentifierAccesstotalVariable or model field reference.
InComparison'key' in objChecks whether a property key exists in an object.
IndexAccessitems[i]Computed index/key/member lookup segment inside bracket access.
InequalityComparisona != bLoose inequality check (with coercion).
InstanceofComparisonvalue instanceof DatePrototype-chain instance check.
LessThanComparisona < bLess-than comparison.
LessThanOrEqualComparisona <= bLess-than-or-equal comparison.
MemberAccessuser.name / user?.nameMember access over object paths. Optional chaining is supported, but not required because rs-x handles null/undefined path segments safely.
MultiplicationArithmetica * bNumeric multiplication.
NewCall / constructionnew Date()Constructor invocation node.
NotLogical!isEnabledLogical negation.
NullLiteralnullNull literal node.
NullishCoalescingLogicalname ?? 'N/A'Nullish-coalescing operator.
NumberLiteral42Number literal node.
ObjectLiteral / structure({ total: a + b })Object literal node.
OrLogicalleft || rightLogical OR with short-circuit behavior (returns first truthy operand).
RegExpLiteral/abc/iRegular expression literal node.
RemainderArithmeticcount % 2Remainder operator.
SequenceControl / ordering(a++, a)Comma sequence; returns the last expression result.
SpreadLiteral / structure({ ...defaults, enabled: true })Spread expansion for objects, arrays, and call arguments.
StrictEqualityComparisona === bStrict equality check (no coercion).
StrictInequalityComparisona !== bStrict inequality check (no coercion).
StringLiteral'hello'String literal node.
SubtractionArithmetica - bNumeric subtraction.
TemplateLiteralLiteral`Hello ${name}`Template string node.
TypeofType / reflectiontypeof value === 'string'JavaScript typeof operator node.
UnaryNegationArithmetic-amountArithmetic negation.
UnaryPlusArithmetic+valueNumeric coercion via unary plus.