API Reference

ExpressionType

ExpressionType describes the node kind for an IExpression via expression.type.

Description

Enum used by IExpression.type to describe each parsed node.

Parameters

No runtime parameters.

Return type

Members resolve to string enum values used for runtime node classification.

Supported expression types

AdditionAdds numbers or concatenates strings depending on operand types.a + b
AndEvaluates left to right and returns the first falsy operand, otherwise the last operand.isReady && isValid
ArrayArray literal node.[a, b, c]
BigIntBigInt literal node.10n
BitwiseAndPerforms bitwise AND between corresponding bits of both operands.a & b
BitwiseLeftShiftShifts bits of the left operand left by the number of bits from the right operand.value << 1
BitwiseNotInverts all bits of the operand.~value
BitwiseOrPerforms bitwise OR between corresponding bits of both operands.a | b
BitwiseRightShiftShifts bits of the left operand right (sign-preserving) by the right operand.value >> 1
BitwiseUnsignedRightShiftShifts bits of the left operand right with zero-fill by the right operand.value >>> 1
BitwiseXorPerforms bitwise XOR between corresponding bits of both operands.a ^ b
BooleanBoolean literal node.true
ConditionalEvaluates a condition and returns either the consequent or alternate branch.a > 0 ? a : 0
DivisionDivides the left numeric operand by the right numeric operand.a / b
EqualityCompares values with JavaScript loose equality semantics (type coercion allowed).a == b
ExponentiationRaises the left operand to the power of the right operand.a ** 2
FunctionRepresents a function call expression and evaluates by invoking the resolved function with arguments.sum(a, b)
GreaterThanReturns true when the left operand is greater than the right operand.a > b
GreaterThanOrEqualReturns true when the left operand is greater than or equal to the right operand.a >= b
IdentifierVariable or model field access.a
InChecks whether a property key exists in an object or its prototype chain.'key' in obj
IndexIndexed access node.items[0]
InequalityCompares values with JavaScript loose inequality semantics (type coercion allowed).a != b
InstanceofChecks whether an object is an instance of a constructor via prototype-chain lookup.value instanceof Date
LessThanReturns true when the left operand is less than the right operand.a < b
LessThanOrEqualReturns true when the left operand is less than or equal to the right operand.a <= b
MemberObject member access.user.name
MultiplicationMultiplies two numeric operands and returns the product.a * b
NewConstructs a new object instance by invoking a constructor with arguments.new Date()
NotConverts the operand to boolean and returns the negated value.!isEnabled
NullNull literal node.null
NullishCoalescingReturns the right operand only when the left operand is null or undefined.name ?? 'N/A'
NumberNumber literal node.42
ObjectObject literal node. In expression strings, wrap object literals in parentheses so they are parsed as an expression, not a block.({ total: a + b })
OrEvaluates left to right and returns the first truthy operand, otherwise the last operand.left || right
RegExpRegular expression literal node./abc/i
RemainderReturns the remainder after dividing the left operand by the right operand.count % 2
SequenceComma operator sequence. It evaluates multiple expressions left-to-right and returns only the last result. Use it when you need side effects first, then a final value.(a++, a)
SpreadSpread element/property. Valid inside array literals, object literals, and function calls. It expands iterable elements or object properties into the surrounding expression.({ ...defaults, enabled: true })
StrictEqualityCompares values without type coercion; both type and value must match.a === b
StrictInequalityCompares values without type coercion and returns true when type or value differs.a !== b
StringString literal node.'hello'
SubtractionSubtracts the right numeric operand from the left numeric operand.a - b
TemplateLiteralTemplate string node.`Hello ${name}`
TypeofReturns the JavaScript runtime type name of the operand as a string.typeof value === 'string'
UnaryNegationConverts operand to number and returns its arithmetic negation.-amount
UnaryPlusConverts the operand to a number without changing its sign.+value