Centara
  • Introduction to Centara
  • Getting started with Centara
    • Software and hardware requirements
    • getCentara.exe
    • Install Centara Server
    • Centara Configuration
      • RDM overview
      • Create organization structure
      • General settings
      • Layouts and visual components
        • Creating layouts
        • Assigning layouts in configuration
        • Populating layouts with components
        • Applying functionalty to buttons
        • UI component reference
      • Hardware
        • OPOS installation
          • Epson OPOS
        • Centara server configuration
      • POS Receipts
        • Receipt parts
        • Receipt Directives
          • Formatting directives
          • General directives
          • Hospitality directives
          • Fiscal Printers directives
          • Tender slip directives
        • Receipt logo
        • Receipt template
          • Special formatting
      • POS operators and permissions
        • Create operators and permissions
      • Tenders
      • Other configuration
        • Customer configuration
        • Cash management
          • Setting up cash management
          • Balance report
        • Suspend / retrieve
        • Search
          • Applying customer search
          • Applying product search
            • Style search
            • Stock search
          • Applying transaction search
        • Custom settings
    • Install Centara POS
      • Alternative database configurations
      • Centara Licensing
    • Features
      • Conditional sub-layouts
      • Out of stock warning
  • User guides
    • POS User Guide
      • Operator sign on / off
      • Layouts
      • Selling products
      • Paying for products
      • Voiding
      • Customers
      • Suspend / retrieve
      • Cash management
    • Discount Offer module
      • Getting started
      • Basic discounts
      • Package deals
      • Seasonal offers
      • Miscellaneous
      • Working with the filters
      • Making changes to the discounts
      • Time restrictions
      • Selectors
      • Layered discounts
      • Audit Log
      • Glossary of Terms
    • Loyalty system
      • System overview
      • Creating organization stucture
      • Working with loyalty data
        • General handling
          • Adding loyalty data
        • Giftcards
          • Adding gift card data
        • Store credit
          • Instrument handling
        • Coupons
          • How to setup alphanumeric offer coupon
      • Connecting Centara to Loyalty
      • View loyalty data on POS
      • Loyalty operations
    • Snippet manager
  • Integrations
    • Sentry.io
    • Acumatica
      • Acumatica installation
      • Acumatica Connector
        • Customer creation
        • Cashier Groups
        • Avalara Configuration
        • Common configuration errors
        • General inquiries
  • Development
    • APIs
      • External orders
      • Item API
      • Loyalty API
        • Gift cards
        • Loyalty cards
        • Store credit
    • GraphQL
    • XVal
      • XVal List comprehensions
      • XVal operators
      • XVal examples
      • XVal usage
      • XVal testing
  • References
    • Data processes
      • XVal Library
      • Data process examples
    • POS macros
  • FAQ
    • Centara Server
      • Installation
      • Maintenance
    • Centara POS
Powered by GitBook
On this page
  • Truthyness and falsyness
  • If-then-else operator
  • Short circuit operators

Was this helpful?

  1. Development
  2. XVal

XVal operators

Truthyness and falsyness

Falsey

Truthy

false

true

0

All other numbers

"" empty-string

All other strings

null

() unit-symbol

All list values

All object values

If-then-else operator

a ? b : c   // This stands for “if a then b else c”

Short circuit operators

The || and && operators are truthy based value short circuit operators.

a && b returns a if a is falsey, or b if a is truthy.

a || b returns a if a is truthy, or b if a is falsy. This can be used for boolean logic (price < 100 && quantity < 3), for value selection based on conditions (price < 100 && ‘cheap’ || ‘expensive’), or for value coalescing (nickname || fullname).

PreviousXVal List comprehensionsNextXVal examples

Last updated 5 years ago

Was this helpful?