isLocalStorageEnabled
Checks if localStorage is enabled.
- Use a try...catchblock to returntrueif all operations complete successfully,falseotherwise.
- Use Storage.setItem()andStorage.removeItem()to test storing and deleting a value inwindow.localStorage.