Close the sidebar
c# .net
Adsense
ADO.NET
Linq
Viruses/security
asp.net MVC
JQuery
Angular-js
Node-js
SEO
Java
C++
SQL
API
Networking
vb.net
.Net
Css
JavaScript
Generics c#.Net
entity framework
HTML
Website host
Website Construction Guide
HTTP tutorial
W3C tutorial
Web Services
JSON
Psychology
Ionic framework
Angular
ReactJS
Python
Computer
Android
Close the sidebar
Ad
Angular
Argument of type 'string | null' is not assignable to parameter of type 'string'.\n Type 'null' is not assignable to type 'string'
By:
Mohamed Rasik
|
Oct,27 2021
|
web
I got this error because, while parsing JSON it is expecting string result.
So when you try to use
localStorage
.
getItem
() you may follow this way,
JSON
.
parse
(
localStorage
.
getItem
(
'currentUser'
)||
'{}'
)
⌃
© 2019 www.infinetsoft.com | All Rights Reserved