Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

object is possibly

const response = await fetchTodos();
console.log(response.data) // object is possibly undefined
// optional chaining
console.log(response?.data) 
// simple null check
if (response && response.data) console.log(response.data)
 
PREVIOUS NEXT
Tagged: #object #possibly
ADD COMMENT
Topic
Name
9+5 =