logo
Spark Docs
logo
Spark Docs
DocumentationCore ConceptsOperators

Operators

Learn how operators are used to perform actions on values in Spark.

Arithmetic Operations

Spark supports basic arithmetic operations on numeric variables. These expressions are transpiled into JavaScript and executed using Node.js.

let a 10
let b 3

# Arithmetic expressions
print a + b   
print a - b   
print a * b   
print a / b   
print a % b

Comparison Operators

Used to compare values and return a boolean ( true or false ).

let a 10
let b 3

# Comparison Operators
print x > y  
print x < y 
print x === y
print x !== y

Logical Operators

Used to combine or invert boolean values.

let isSunny true
let isWeekend false

print isSunny && isWeekend
print isSunny || isWeekend
print !isSunny