Answers for "nullish coalesing"

3

nullish coalesing

Expression:
	Left ?? Right
if left is null or undefined , then Right will be the value 

const a = '' ;
const b = undefined;

const c = a ?? 'default' ; // will give c =''
const d = b ?? 'default' ; // wil give d = 'default'
Posted by: Guest on October-18-2020

Browse Popular Code Answers by Language