Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

Logical Assignment Operator null coalescing

const a = null;
const b = 3;
a ??= b;
console.log(a); // returns 3
// the above statement is equivalent to
if (a === null || a === undefined) {
  a = b;
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: useLinkPressHandler 
Javascript :: how to get current row value by clicking a button 
Javascript :: "create a chatbot using javascript only" 
Javascript :: vue block other script event listeners 
Javascript :: javascript add unique values to array 
Javascript :: Implicit Return Shorthand in javascript 
Javascript :: get selected value of select2 dropdown in jquery 
Javascript :: escape exponential input number in js 
Javascript :: how to find prime factors of a number in javascript 
Javascript :: function for making something invisible in gdscript 
Javascript :: linux pupperteer 
Javascript :: JS call url many times 
Javascript :: jquery replacechild 
Javascript :: cercle progress bar angular 
Javascript :: bytes to uppercase hex javascript 
Javascript :: vscode redirect back 
Javascript :: c program to print triangle using recursion in javascript 
Javascript :: 4.6.3. Order of Operations¶ 
Javascript :: sentry not working in frontend 
Javascript :: how to get 4 columns with masonryjs 
Javascript :: p5 js stop video camera capture 
Javascript :: react get padding 
Javascript :: Get characters between two characters 
Javascript :: api call in react chart 
Javascript :: Rest and spread operators in ES6 
Javascript :: format file using jq 
Javascript :: fcus on element 
Javascript :: Create an Array of specific length with some value at each index 
Javascript :: programmatically change mongoose schema enum values 
Javascript :: convert path string to url encoding javascript 
ADD CONTENT
Topic
Content
Source link
Name
2+8 =