Function name to clear the item in local storage is - code example
Example 1: localstorage clear item
localStorage.removeItem(key);
Example 2: javascript localStorage clear items
localStorage.clear();//this clears the localStorage completely
localStorage.removeItem(key);
localStorage.clear();//this clears the localStorage completely