This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { useEffect, useState } from "react"; | |
// It uses the useState hook to manage the state of the filtered data, | |
// and an input field with an onKeyUp event listener to trigger the filtering function. | |
// When the function is called, it filters the list of items based on | |
// whether the item's name includes the search query, and updates the state of the filtered data. | |
// The component then renders the list of items or a message indicating that no data was found, | |
// depending on whether there are any items in the filtered data array. | |
const App = () => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This function will send a notification to the user. | |
// If the user has not granted permission to show notifications | |
// it will ask for permission. | |
function sendNotification() { | |
// Check if the browser supports notifications | |
if (!("Notification" in window)) { | |
console.log("This browser does not support notifications."); | |
} | |
// Check if the user has granted permission to show notifications | |
else if (Notification.permission === "granted") { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const passwordGen = ( | |
length = 8, | |
{ | |
includeLowercase: inLc = true, | |
includeUppercase: inUc = true, | |
includeNumbers: inN = true, | |
includeSymbols: inS = true, | |
numberOfSymbols: nOfS = 1, | |
numberOfNumbers: nOfN = 1, | |
numberOfUppercase: nOfUc = 1, |