This repository is a personal collection of reusable JavaScript utility functions and React components. The goal is to build an efficient, well-documented library of code snippets and solutions to common problems, allowing for faster development and a deeper understanding of core concepts.
This folder contains general-purpose JavaScript functions that can be used in any project.
This file includes functions for manipulating strings.
| Function | Description |
|---|---|
capitalizeFirstLetter(str) |
Capitalizes the first letter of a given string. |
This file contains functions for working with arrays.
| Function | Description |
|---|---|
removeDuplicates(arr) |
Removes duplicate elements from an array. |
This folder houses reusable React components.
A simple, reusable button component.
<Button text="Click Me" onClick={() => console.log('Button clicked!')} />| Prop | Type | Description |
|---|---|---|
text |
string | The text to display inside the button. |
onClick |
function | The function to be called when the button is clicked. |
To use a function or component from this library, simply import it into your project file:
// Example: Importing a helper function
import { capitalizeFirstLetter } from './my-code-library/javascript-utils/string-helpers.js';
// Example: Importing a React component
import Button from './my-code-library/react-components/Button.jsx';This toolkit is a work in progress. I plan to add more utilities and components as I continue to practice and learn, including:
- Form validation functions.
- A custom useLocalStorage React Hook.
- More complex components like a Modal or a Card.