local-storage
allows to read and write its value to the key in localStorage
.
The type
attribute allows to place the validation constrains to the value: when the value does not
match the expected type, it would not be assigned, keeping empty value
instead.