Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Cannot call `JSON.parse` with item bound to `text` because null or undefined [1] is incompatible with string

JSON.parse(localStorage.getItem("key") || 'null') // null

JSON.parse(localStorage.getItem("key") || '{}') // {} - empty object 
 
PREVIOUS NEXT
Tagged: #Cannot #call #item #bound #null #undefined #incompatible #string
ADD COMMENT
Topic
Name
8+8 =