Monday 19 February 2024

Apex Null Coalescing Operator

 

Introduction

The Spring 24 release of Salesforce bring a new operator to Apex - the null coalescing operator. It makes me very happy when these kinds of operators make their way to Apex, as it feels like we're a real programming language!

The null coalescing operator consists of an operand, two question marks, and another operand:

operand1 ?? operand2

Apex Null Coalescing Operator

  Introduction The Spring 24 release of Salesforce bring a new operator to Apex - the null coalescing operator. It makes me very happy when ...