This file contains 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 { leftsidebarLinks } from '@/constants'; | |
type INavLink = { | |
imgURL: string; | |
route: string; | |
label: string; | |
}; | |
const LeftSidebar = () => { |
This file contains 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
export const leftsidebarLinks = [ | |
{ | |
route: "/", | |
label: "Home", | |
}, | |
{ | |
route: "/settings", | |
label: "Settings", | |
}, | |
{ |
This file contains 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 LeftSidebar = () => { | |
return ( | |
<nav className='leftsidebar'> | |
<ul className='flex flex-col gap-6'> | |
<li> | |
<NavLink to="/">Home</NavLink> | |
</li> | |
<li> | |
<NavLink to="/settings">Settings</NavLink> | |
</li> |
This file contains 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
npm i -D babel-plugin-twin |
This file contains 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
// THE WILD SKIP FLAG DEMONSTRATION | |
const wildSkipFlagStatement = /G*i/; // declaring the regular expression | |
const thePassingStatement = 'G33167893hfaskj$&.i'; // passing multiple characters inplace of the flag | |
const theResult = thePassingStatement.match(wildSkipFlagStatement); //valuating... | |
console.log(theResult); //logging result. |
This file contains 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
// THE SKIP FLAG DEMONSTRATION | |
const skipFlagStatement = /Y.sir/g; //declaring a regular expression with the skip and global flag | |
const thePassingStatement = 'Yasir, Yusir, and Ynsir is allowed thanks to the skip flag which permits any letter inplace of the flag character'; | |
const theResult = thePassingStatement.match(skipFlagStatement); // valuating... | |
console.log(theResult); // returning the result |
This file contains 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
// VALUATING THE REGULAR EXPRESSION USING THE "replace()" FUNCTION | |
const stillTheFirstWay = /words between slahses/; //declared regular expression | |
const anExpression = 'The words between slahses has been replaced thanks to the ".replace()" function'; //declared statement | |
const thereplacedExpression = anExpression.replace(stillTheFirstWay, 'statements'); //valuating | |
console.log(thereplacedExpression); |
This file contains 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
// VALUATING THE REGULAR EXPRESSION USING THE "search()" FUNCTION | |
const stillTheFirstWay = /words between slahses/; //declared regular expression | |
const thePassingStatement = 'this is a sentence with words between slahses being evaluated with the search() function'; | |
const theResult = thePassingStatement.search(stillTheFirstWay); | |
console.log(theResult); |
This file contains 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
// VALUATING THE REGULAR EXPRESSION USING THE "match()" FUNCTION | |
const stillTheFirstWay = /words between slahses/; //declared regular expression | |
const thePassingStatement = 'this is a sentence with words between slahses being evaluated with the match() function'; | |
const theResult = thePassingStatement.match(stillTheFirstWay); | |
console.log(theResult); |
This file contains 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
// VALUATING THE REGULAR EXPRESSION USING THE "test()" FUNCTION | |
const stillTheFirstWay = /words between slahses/; //declaring the regular expression | |
const theResult = stillTheFirstWay.test('this is a sentence between slahses being evaluated with the test() function'); | |
console.log(theResult); //valuating the expression |
NewerOlder