Thursday, January 23, 2025

code

  • Local Storage: Data stored with no expiration time. The data persists even when the browser is closed and reopened.
    Session Storage: Data that is only available for the duration of the page session. It is cleared when the page session ends, which typically happens when the browser or tab is closed.

    localStorage.setItem('key', 'value');
    sessionStorage.setItem('key', 'value');
    let value = localStorage.getItem('key');
    console.log(value);  // Output: value
    
    let value = sessionStorage.getItem('key');
    console.log(value);  // Output: value
    localStorage.removeItem('key');//To remove an item from local storage:
    sessionStorage.removeItem('key');
    localStorage.clear();//to clear all items from local storage:
    
    sessionStorage.clear();

    ----

  • What it is: Authentication is the process of verifying the identity of a user or entity.
    passwords

  • What it is: Authorization is the process of determining what an authenticated user is allowed to do.
    Purpose: To ensure that the user has permission to access specific resources or perform specific actions.
    Authentication:
     Showing your ticket at the entrance to prove you are a valid attendee.
    Authorization: Accessing different areas of the venue (e.g., general seating, VIP lounge) based on the permissions granted by your ticket.






  •  palindrome

     




    features of react
    Virtual DOM:
    Component-Based Architecture
    JSX (JavaScript XML
    One-Way Data Binding
    State Management
    Lifecycle Methods
    Hooks
    React Router
    Server-Side Rendering (SSR)












    No comments:

    Post a Comment