Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js optional chaining array

// For arrays
const friendAtPositionZeroIfItExists = user?.friends?.[0]
Source by dev.to #
 
PREVIOUS NEXT
Tagged: #js #optional #chaining #array
ADD COMMENT
Topic
Name
5+2 =