{"id":25319397,"url":"https://github.com/indianmodassir/shorts","last_synced_at":"2025-07-10T07:04:44.512Z","repository":{"id":267158219,"uuid":"900412898","full_name":"indianmodassir/shorts","owner":"indianmodassir","description":null,"archived":false,"fork":false,"pushed_at":"2025-01-19T17:26:20.000Z","size":256,"stargazers_count":9,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-07T18:19:12.661Z","etag":null,"topics":["method","plugins","shorts","yt-shorts","yt-shorts-source-code"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/indianmodassir.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-08T17:57:50.000Z","updated_at":"2025-01-19T17:26:21.000Z","dependencies_parsed_at":null,"dependency_job_id":"3d9febe5-46d3-434b-a630-52c3f1dce3c0","html_url":"https://github.com/indianmodassir/shorts","commit_stats":null,"previous_names":["shahzadamodassir/shorts","indianmodassir/shorts"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/indianmodassir/shorts","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/indianmodassir%2Fshorts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/indianmodassir%2Fshorts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/indianmodassir%2Fshorts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/indianmodassir%2Fshorts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/indianmodassir","download_url":"https://codeload.github.com/indianmodassir/shorts/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/indianmodassir%2Fshorts/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264545017,"owners_count":23625387,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["method","plugins","shorts","yt-shorts","yt-shorts-source-code"],"created_at":"2025-02-13T20:16:55.276Z","updated_at":"2025-07-10T07:04:44.277Z","avatar_url":"https://github.com/indianmodassir.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Source Code of YouTube Shorts\n\n[![Authors](https://img.shields.io/badge/Author-Shahzada%20Modassir-%2344cc11?style=flat-square\u0026color=%23007ec6)](https://github.com/indianmodassir)\n[![License](https://img.shields.io/github/license/indianmodassir/shorts?style=flat-square\u0026color=%23007ec6)](https://github.com/indianmodassir/shorts/blob/main/LICENSE)\n[![YouTube Views](https://img.shields.io/youtube/channel/views/UCzo3rbUc4Yr1C-Zv9B9nfKw?style=flat-square\u0026logo=youtube)](https://youtube.com/@indianmodassir)\n[![YouTube Subscribers](https://img.shields.io/youtube/channel/subscribers/UCzo3rbUc4Yr1C-Zv9B9nfKw?style=flat-square\u0026logo=youtube)](https://youtube.com/@indianmodassir)\n[![Github Followers](https://img.shields.io/github/followers/indianmodassir?style=flat-square\u0026logo=github)](https://github.com/indianmodassir?tab=followers)\n[![X](https://img.shields.io/twitter/follow/Xsmodassir?style=flat-square\u0026logo=x\u0026color=%2300000000)](https://x.com/Xsmodassir)\n\n## Web Shorts HTML, CSS or JavaScript\n\nWatch all Web shorts video on youtube see playlist [Web Shorts](https://www.youtube.com/playlist?list=PLnnLdunPzY2t2iQ7X8BAUh4s8Yx-2KR7z)\n\n### CSS Loader\n\n[![Shorts Views](https://img.shields.io/youtube/views/xNTnGptbhl0?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/xNTnGptbhl0)\n[![Shorts Likes](https://img.shields.io/youtube/likes/xNTnGptbhl0?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/xNTnGptbhl0)\n[![Shorts Comments](https://img.shields.io/youtube/comments/xNTnGptbhl0?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/xNTnGptbhl0)\n\nWatch video shorts on youtube click: [Watch Now](https://www.youtube.com/shorts/xNTnGptbhl0)\n\nDownload Zip \u003ca href=\"https://github.com/indianmodassir/shorts/raw/refs/heads/main/source/xNTnGptbhl0.zip\" download=\"xNTnGptbhl0\"\u003exNTnGptbhl0.zip\u003c/a\u003e\n\n### Crousel, Image Slider\n\n[![Shorts Views](https://img.shields.io/youtube/views/pS5geDvyYh0?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/pS5geDvyYh0)\n[![Shorts Likes](https://img.shields.io/youtube/likes/pS5geDvyYh0?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/pS5geDvyYh0)\n[![Shorts Comments](https://img.shields.io/youtube/comments/pS5geDvyYh0?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/pS5geDvyYh0)\n\nWatch video shorts on youtube click: [Watch Now](https://www.youtube.com/shorts/pS5geDvyYh0)\n\nDownload Zip \u003ca href=\"https://github.com/indianmodassir/shorts/raw/refs/heads/main/source/pS5geDvyYh0.zip\" download=\"pS5geDvyYh0\"\u003epS5geDvyYh0.zip\u003c/a\u003e\n\n### Horizontal Scroll with Mouse Wheel\n\n[![Shorts Views](https://img.shields.io/youtube/views/osnzwEcRMIg?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/osnzwEcRMIg)\n[![Shorts Likes](https://img.shields.io/youtube/likes/osnzwEcRMIg?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/osnzwEcRMIg)\n[![Shorts Comments](https://img.shields.io/youtube/comments/osnzwEcRMIg?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/osnzwEcRMIg)\n\nWatch video shorts on youtube click: [Watch Now](https://www.youtube.com/shorts/osnzwEcRMIg)\n\nDownload Zip \u003ca href=\"https://github.com/indianmodassir/shorts/raw/refs/heads/main/source/osnzwEcRMIg.zip\" download=\"osnzwEcRMIg\"\u003eosnzwEcRMIg.zip\u003c/a\u003e\n\n### Password Show Hide in CSS\n\n[![Shorts Views](https://img.shields.io/youtube/views/WUkI4P_Nd18?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/WUkI4P_Nd18)\n[![Shorts Likes](https://img.shields.io/youtube/likes/WUkI4P_Nd18?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/WUkI4P_Nd18)\n[![Shorts Comments](https://img.shields.io/youtube/comments/WUkI4P_Nd18?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/WUkI4P_Nd18)\n\nWatch video shorts on youtube click: [Watch Now](https://www.youtube.com/shorts/WUkI4P_Nd18)\n\nDownload Zip \u003ca href=\"https://github.com/indianmodassir/shorts/raw/refs/heads/main/source/WUkI4P_Nd18.zip\" download=\"WUkI4P_Nd18\"\u003eWUkI4P_Nd18.zip\u003c/a\u003e\n\n### Switch Color theme Light Mode and Dark Mode\n\n[![Shorts Views](https://img.shields.io/youtube/views/0dvP4h8NbK8?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/0dvP4h8NbK8)\n[![Shorts Likes](https://img.shields.io/youtube/likes/0dvP4h8NbK8?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/0dvP4h8NbK8)\n[![Shorts Comments](https://img.shields.io/youtube/comments/0dvP4h8NbK8?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/0dvP4h8NbK8)\n\nWatch video shorts on youtube click: [Watch Now](https://www.youtube.com/shorts/0dvP4h8NbK8)\n\nDownload Zip \u003ca href=\"https://github.com/indianmodassir/shorts/raw/refs/heads/main/source/0dvP4h8NbK8.zip\" download=\"0dvP4h8NbK8\"\u003e0dvP4h8NbK8.zip\u003c/a\u003e\n\n### Sound Wave Effect\n\n[![Shorts Views](https://img.shields.io/youtube/views/0QznJVfa-9o?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/0QznJVfa-9o)\n[![Shorts Likes](https://img.shields.io/youtube/likes/0QznJVfa-9o?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/0QznJVfa-9o)\n[![Shorts Comments](https://img.shields.io/youtube/comments/0QznJVfa-9o?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/0QznJVfa-9o)\n\nWatch video shorts on youtube click: [Watch Now](https://www.youtube.com/shorts/0QznJVfa-9o)\n\nDownload Zip \u003ca href=\"https://github.com/indianmodassir/shorts/raw/refs/heads/main/source/0QznJVfa-9o.zip\" download=\"0QznJVfa-9o\"\u003e0QznJVfa-9o.zip\u003c/a\u003e\n\n### Matrix Effect\n\n[![Shorts Views](https://img.shields.io/youtube/views/2RNt5-2CLzM?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/2RNt5-2CLzM)\n[![Shorts Likes](https://img.shields.io/youtube/likes/2RNt5-2CLzM?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/2RNt5-2CLzM)\n[![Shorts Comments](https://img.shields.io/youtube/comments/2RNt5-2CLzM?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/2RNt5-2CLzM)\n\nWatch video shorts on youtube click: [Watch Now](https://www.youtube.com/shorts/2RNt5-2CLzM)\n\nDownload Zip \u003ca href=\"https://github.com/indianmodassir/shorts/raw/refs/heads/main/source/2RNt5-2CLzM.zip\" download=\"2RNt5-2CLzM\"\u003e2RNt5-2CLzM.zip\u003c/a\u003e\n\n### Analog Clock\n\n[![Shorts Views](https://img.shields.io/youtube/views/nd0clfsUOjw?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/nd0clfsUOjw)\n[![Shorts Likes](https://img.shields.io/youtube/likes/nd0clfsUOjw?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/nd0clfsUOjw)\n[![Shorts Comments](https://img.shields.io/youtube/comments/nd0clfsUOjw?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/nd0clfsUOjw)\n\nWatch video shorts on youtube click: [Watch Now](https://www.youtube.com/shorts/nd0clfsUOjw)\n\nDownload Zip \u003ca href=\"https://github.com/indianmodassir/shorts/raw/refs/heads/main/source/nd0clfsUOjw.zip\" download=\"nd0clfsUOjw\"\u003end0clfsUOjw.zip\u003c/a\u003e\n\n### Calculator\n\n[![Shorts Views](https://img.shields.io/youtube/views/GiOkdt5HNgc?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/GiOkdt5HNgc)\n[![Shorts Likes](https://img.shields.io/youtube/likes/GiOkdt5HNgc?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/GiOkdt5HNgc)\n[![Shorts Comments](https://img.shields.io/youtube/comments/GiOkdt5HNgc?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/GiOkdt5HNgc)\n\nWatch video shorts on youtube click: [Watch Now](https://www.youtube.com/shorts/GiOkdt5HNgc)\n\nDownload Zip \u003ca href=\"https://github.com/indianmodassir/shorts/raw/refs/heads/main/source/GiOkdt5HNgc.zip\" download=\"GiOkdt5HNgc\"\u003eGiOkdt5HNgc.zip\u003c/a\u003e\n\n### Code Editor\n\n[![Shorts Views](https://img.shields.io/youtube/views/2WQb3tVJe9k?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/2WQb3tVJe9k)\n[![Shorts Likes](https://img.shields.io/youtube/likes/2WQb3tVJe9k?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/2WQb3tVJe9k)\n[![Shorts Comments](https://img.shields.io/youtube/comments/2WQb3tVJe9k?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/2WQb3tVJe9k)\n\nWatch video shorts on youtube click: [Watch Now](https://www.youtube.com/shorts/2WQb3tVJe9k)\n\nDownload Zip \u003ca href=\"https://github.com/indianmodassir/shorts/raw/refs/heads/main/source/2WQb3tVJe9k.zip\" download=\"2WQb3tVJe9k\"\u003e2WQb3tVJe9k.zip\u003c/a\u003e\n\n### SVG Loader\n\n[![Shorts Views](https://img.shields.io/youtube/views/DkJjhyrpREQ?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/DkJjhyrpREQ)\n[![Shorts Likes](https://img.shields.io/youtube/likes/DkJjhyrpREQ?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/DkJjhyrpREQ)\n[![Shorts Comments](https://img.shields.io/youtube/comments/DkJjhyrpREQ?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/DkJjhyrpREQ)\n\nWatch video shorts on youtube click: [Watch Now](https://www.youtube.com/shorts/DkJjhyrpREQ)\n\nDownload Zip \u003ca href=\"https://github.com/indianmodassir/shorts/raw/refs/heads/main/source/DkJjhyrpREQ.zip\" download=\"DkJjhyrpREQ\"\u003eDkJjhyrpREQ.zip\u003c/a\u003e\n\n### Draggable List\n\n[![Shorts Views](https://img.shields.io/youtube/views/ZxOHPXOZ4q8?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/ZxOHPXOZ4q8)\n[![Shorts Likes](https://img.shields.io/youtube/likes/ZxOHPXOZ4q8?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/ZxOHPXOZ4q8)\n[![Shorts Comments](https://img.shields.io/youtube/comments/ZxOHPXOZ4q8?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/ZxOHPXOZ4q8)\n\nWatch video shorts on youtube click: [Watch Now](https://www.youtube.com/shorts/ZxOHPXOZ4q8)\n\nDownload Zip \u003ca href=\"https://github.com/indianmodassir/shorts/raw/refs/heads/main/source/ZxOHPXOZ4q8.zip\" download=\"ZxOHPXOZ4q8\"\u003eZxOHPXOZ4q8.zip\u003c/a\u003e\n\n### Bounce Loader\n\n[![Shorts Views](https://img.shields.io/youtube/views/0nlHZn1Q4Gk?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/0nlHZn1Q4Gk)\n[![Shorts Likes](https://img.shields.io/youtube/likes/0nlHZn1Q4Gk?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/0nlHZn1Q4Gk)\n[![Shorts Comments](https://img.shields.io/youtube/comments/0nlHZn1Q4Gk?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/0nlHZn1Q4Gk)\n\nWatch video shorts on youtube click: [Watch Now](https://www.youtube.com/shorts/0nlHZn1Q4Gk)\n\n```html\n\u003c!DOCTYPE html\u003e\n\u003chtml lang=\"en\"\u003e\n\u003chead\u003e\n  \u003cmeta charset=\"UTF-8\"\u003e\n  \u003cmeta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"\u003e\n  \u003ctitle\u003eDocument\u003c/title\u003e\n  \u003cstyle\u003e\n    * {\n      padding: 0;\n      margin: 0;\n      box-sizing: border-box;\n    }\n\n    body {\n      width: 100vw;\n      height: 100vh;\n    }\n\n    body {\n      display: flex;\n      align-items: center;\n      justify-content: center;\n    }\n\n    .bounce-loader {\n      display: flex;\n      width: 24px;\n      height: 40px;\n      justify-content: space-between;\n    }\n\n    .bounce-loader span {\n      border-radius: 10px;\n      width: 6px;\n      height: 100%;\n      background-color: #a6a6a6;\n      animation: loading 0.6s var(--i) ease-in-out infinite;\n    }\n\n    @keyframes loading {\n      0%, 100% {\n        transform: scaleY(0.2);\n        opacity: 0.8;\n      }\n\n      50% {\n        transform: scaleY(1);\n        opacity: 1;\n      }\n    }\n  \u003c/style\u003e\n\u003c/head\u003e\n\u003cbody\u003e\n\n  \u003cdiv class=\"bounce-loader\"\u003e\n    \u003cspan style=\"--i: 0s\"\u003e\u003c/span\u003e\n    \u003cspan style=\"--i: 0.15s\"\u003e\u003c/span\u003e\n    \u003cspan style=\"--i: 0.3s\"\u003e\u003c/span\u003e\n  \u003c/div\u003e\n  \n\u003c/body\u003e\n\u003c/html\u003e\n```\n\n## Javascript YT Shorts Source Code\n\nWatch all JavaScript shorts video on youtube see playlist [JavaScript Shorts](https://www.youtube.com/playlist?list=PLnnLdunPzY2srl1Iy4xHkKWaGQ-CUepNk)\n\n### memoize\n\n[![Shorts Views](https://img.shields.io/youtube/views/N_qQc43ZKds?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/N_qQc43ZKds)\n[![Shorts Likes](https://img.shields.io/youtube/likes/N_qQc43ZKds?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/N_qQc43ZKds)\n[![Shorts Comments](https://img.shields.io/youtube/comments/N_qQc43ZKds?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/N_qQc43ZKds)\n\nWatch video shorts on youtube click: [Watch Now](https://www.youtube.com/shorts/N_qQc43ZKds)\n\n```js\n/**\n * Speed up your code with memoization!\n * 🚀 Caching results for faster performance!\n * @param {function} fn\n * @param {function} func\n * @returns A callback Function\n */\nfunction memoize(fn, func) {\n  let result, key, cache = new Map();\n\n  return function() {\n    key = JSON.stringify(arguments);\n\n    // If key in cache, then return the cached result\n    return cache.has(key) ? (\n      result = cache.get(key),\n      func(result),\n      result\n\n    // Otherwise\n    ) : (\n      result = fn(...arguments),\n      cache.set(key, result),\n      result\n    );\n  };\n}\n\n// Example usage:\n\n// For example, This is your big Handler\nlet bigHandler = (end) =\u003e {\n  for(let i = 0; i \u003c end; i++) {}\n  console.log(\"\\nFrom Handler: \" + end);\n  return end;\n};\n\nlet memoizedAdd = memoize(bigHandler,\n  // Optional argument\n  // This func will be invoked when data is loaded from the cache\n  function(res) {\n    console.log(\"\\nFrom Cache: \" + res);\n  });\n\n// Testing with Outputs:\nconsole.time();\nmemoizedAdd(100000000);\nconsole.timeEnd();\n\nconsole.time();\nmemoizedAdd(100000000);\nconsole.timeEnd();\n\nconsole.time();\nmemoizedAdd(500000000);\nconsole.timeEnd();\n\nconsole.time();\nmemoizedAdd(500000000);\nconsole.timeEnd();\n```\n\n### cloneDeep\n\n[![Shorts Views](https://img.shields.io/youtube/views/iybtOI8yJgk?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/iybtOI8yJgk)\n[![Shorts Likes](https://img.shields.io/youtube/likes/iybtOI8yJgk?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/iybtOI8yJgk)\n[![Shorts Comments](https://img.shields.io/youtube/comments/iybtOI8yJgk?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/iybtOI8yJgk)\n\nWatch video shorts on youtube click: [Watch Now](https://www.youtube.com/shorts/iybtOI8yJgk)\n\n```js\n/**\n * Function to perform deep cloning of an object or array\n * @param {object|array} obj\n * @returns The cloned array or object\n */\nfunction cloneDeep(obj) {\n  if (obj === null || typeof obj !== 'object') {\n    return obj;\n  }\n\n  let clone = Array.isArray(obj) ? [] : {},\n    key;\n\n  for(key in obj) {\n    if (obj.hasOwnProperty(key)) {\n      clone[key] = cloneDeep(obj[key]);\n    }\n  }\n\n  return clone;\n}\n\n// Example usage:\nconst orig = {\n  name: 'modassir',\n  details: {age: 22, addr: 'RFJ'},\n  hobbies: ['coding', 'reading']\n};\n\nconst copied = cloneDeep(orig);\ncopied.details.age = 23;\ncopied.hobbies[1] = 'travelling';\n\n// Outputs:\nconsole.log('Original:', orig);\nconsole.log('Copied:', copied);\n```\n\n### debounce\n\n[![Shorts Views](https://img.shields.io/youtube/views/VItEOPa7b58?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/VItEOPa7b58)\n[![Shorts Likes](https://img.shields.io/youtube/likes/VItEOPa7b58?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/VItEOPa7b58)\n[![Shorts Comments](https://img.shields.io/youtube/comments/VItEOPa7b58?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/VItEOPa7b58)\n\nWatch video shorts on youtube click: [Watch Now](https://www.youtube.com/shorts/VItEOPa7b58)\n\n```js\n/**\n * debounce function to limit the rate at which a function is invoked\n * @param {function} fn\n * @param {number} delay\n */\nfunction debounce(fn, delay) {\n  let id;\n  return function() {\n    // Clear previous timeout,\n    // to reset the delay\n    clearTimeout(id);\n\n    // Set a new timeout\n    id = setTimeout(fn, delay || 1000, ...arguments);\n  };\n}\n\n// Example usage:\n\nconst searchHandler = (search) =\u003e {\n  console.log('Fetching database with query:' + search);\n};\n\n// swd -\u003e search with debounce\nlet swd = debounce(searchHandler);\n\n// Call without debounce\nswd('ja');\nswd('java');\nswd('javasc');\nswd('javascri');\nswd('javascript');\n```\n\n### Serialize\n\n[![Shorts Views](https://img.shields.io/youtube/views/HOVlf_olxTc?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/HOVlf_olxTc)\n[![Shorts Likes](https://img.shields.io/youtube/likes/HOVlf_olxTc?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/HOVlf_olxTc)\n[![Shorts Comments](https://img.shields.io/youtube/comments/HOVlf_olxTc?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/HOVlf_olxTc)\n\nWatch video shorts on youtube click: [Watch Now](https://www.youtube.com/shorts/HOVlf_olxTc)\n\n```js\n/**\n * Serialize an array of form elements or a set of\n * key/values into a query string\n */\nfunction serialize(data, trad) {\n  let prefix, s = [],\n    add = function(key, val) {\n      s[s.length] = encodeURIComponent(key) + '=' +\n        encodeURIComponent(val == null ? '' : val);\n    };\n\n  if (data == null) return '';\n\n  // [['key','value']] or [{name: '', value: ''}]\n  if (Array.isArray(data)) {\n    for(prefix of data) {\n      add(\n        prefix[0] || prefix.name,\n        prefix[1] || prefix.value\n      );\n    }\n  } else {\n    // Encode params recursively.\n    // {name: {...}, key: [...]} or {key: value}\n    for(prefix in data) {\n      makeParams(prefix, data[prefix], trad, add);\n    }\n  }\n\n  return s.join('\u0026');\n}\n\nfunction makeParams(prefix, mixed, trad, add) {\n  let name, rbracket = /\\[\\]$/;\n\n  if (Array.isArray(mixed)) {\n    // Serialize array item.\n    mixed.forEach(function(v, i) {\n      trad || rbracket.test(prefix) ? add(prefix, v) :\n        makeParams(\n          prefix + '[' + (typeof v == 'object' \u0026\u0026 v != null ? i : '') + ']',\n          v,\n          trad,\n          add\n        );\n    });\n  } else if (!trad \u0026\u0026 typeof mixed === 'object') {\n    // Serialize object item.\n    for(name in mixed) {\n      makeParams(prefix + '[' + name + ']', mixed[name], trad, add);\n    }\n  } else {\n    // Serialize scalar item.\n    add(prefix, mixed);\n  }\n}\n\n// Example usage:\nlet data = {id: 3, email: 'example@gmai.com', pass: 12354};\nlet arr = [['name', 'modassir'], {name: 'age', value: 22}];\nlet obj = {id: 1, param: {one:1, two: 2}, index: [1,2,3,4,5]};\n\n// Outputs:\nserialize(data);      // Outputs: id=3\u0026email=example%40gmai.com\u0026pass=12354\nserialize(arr);       // Outputs: name=modassir\u0026age=22\nserialize(obj);       // Outputs: id=1\u0026param%5Bone%5D=1\u0026param%5Btwo%5D=2\u0026index%5B%5D=1\u0026index%5B%5D=2\u0026index%5B%5D=3\u0026index%5B%5D=4\u0026index%5B%5D=5\nserialize(obj, true); // Outputs: id=1\u0026param=%5Bobject%20Object%5D\u0026index=1\u0026index=2\u0026index=3\u0026index=4\u0026index=5\n```\n\n### ArrayUnique\n\n[![Shorts Views](https://img.shields.io/youtube/views/JQG5HDsVM_g?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/JQG5HDsVM_g)\n[![Shorts Likes](https://img.shields.io/youtube/likes/JQG5HDsVM_g?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/JQG5HDsVM_g)\n[![Shorts Comments](https://img.shields.io/youtube/comments/JQG5HDsVM_g?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/JQG5HDsVM_g)\n\nWatch video shorts on youtube click: [Watch Now](https://www.youtube.com/shorts/JQG5HDsVM_g)\n\n```js\n/**\n * Function to remove duplicate elements from an array.\n * @param {array} arr \n * @param {boolean} isRef \n * @returns Unique Array\n */\nfunction ArrayUnique(arr, isRef) {\n  // Create a new array of unique elements\n  let unique = [...new Set(arr)];\n\n  // If isRef, Modify the original array by reference\n  if (isRef) {\n    // First we will empty the original array\n    arr.length = 0;\n\n    // Now we will push the unique array into the original array\n    [].push.apply(arr, unique);\n  }\n\n  return unique;\n}\n\n// Example usage with outputs\nlet arr = [1,2,3,4,1,2,3,4,1,2,3,4];\nArrayUnique(arr);       // Outputs: [1,2,3] Return a new array without modified in original array\nArrayUnique(arr, true); // Outputs: [1,2,3] Return a new array with modified original array by reference\n```\n\n### upm (User Password Manager) Library\n\n[![Shorts Views](https://img.shields.io/youtube/views/D06gC1fyjgY?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/D06gC1fyjgY)\n[![Shorts Likes](https://img.shields.io/youtube/likes/D06gC1fyjgY?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/D06gC1fyjgY)\n[![Shorts Comments](https://img.shields.io/youtube/comments/D06gC1fyjgY?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/D06gC1fyjgY)\n\nWatch video shorts on youtube click: [Watch Now](https://www.youtube.com/shorts/D06gC1fyjgY)\n\nCreate a `storage.json` file on current working directory\n```json\n{}\n```\n\nThen create `upm.js` Javascript Library File on current working directory\n```js\nconst upm = {}; // user password manager\nconst path = 'storage.json';\nconst fs = require('fs');\n\n/**\n * Gets password, If user exists in storage\n * @param {string} username \n * @returns \n */\nupm.get = function(username) {\n  return (this.getAll()[username] || {}).password;\n}\n\n/**\n * Returns all saved storage data\n * @returns All storage data\n */\nupm.getAll = function() {\n  return JSON.parse(fs.readFileSync(path, {encoding: 'utf8'}));\n}\n\n/**\n * Save new password, If user does not exists\n * @param {string} username \n * @param {string} password \n * @returns true or undefined\n */\nupm.save = function(username, password) {\n  let date = (new Date).toLocaleString(),\n    storage = this.getAll();\n\n  if (!this.get(username)) {\n    if (password) storage[username] = {password, date};\n    fs.writeFileSync(path, JSON.stringify(storage, null, 2));\n    return true;\n  }\n}\n\n// Example usage:\n\n// Save Password in Storage\nupm.save('GmailPass', '123@gmail');\nupm.save('FBPass', '123@facebook');\nupm.save('InstaPass', '123@insta');\n\n// View all saved data\nupm.getAll();\n\n// Get Passwword of Specific User\nupm.get('GmailPass');\nupm.get('InstaPass');\n```\n\n### encrypt and decrypt\n\n[![Shorts Views](https://img.shields.io/youtube/views/8j_JdzFA5A4?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/8j_JdzFA5A4)\n[![Shorts Likes](https://img.shields.io/youtube/likes/8j_JdzFA5A4?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/8j_JdzFA5A4)\n[![Shorts Comments](https://img.shields.io/youtube/comments/8j_JdzFA5A4?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/8j_JdzFA5A4)\n\nWatch video shorts on youtube click: [Watch Now](https://www.youtube.com/shorts/8j_JdzFA5A4)\n\n```js\nconst crypto = require('crypto');\n\n/**\n * Encrypts the given data using AES-256-GCM encryption algorithm\n * @param {string} data\n * @param {key} key\n * @returns {string} Encrypted plainText\n */\nfunction encrypt(data, key) {\n  let encrypted, cipher, tag,\n    iv = crypto.randomBytes(16);\n\n  key = crypto.createHash('sha256').update(key).digest();\n  cipher = crypto.createCipheriv('AES-256-GCM', key, iv);\n\n  encrypted = cipher.update(data, 'utf-8', 'base64');\n  encrypted += cipher.final('base64');\n\n  return btoa(JSON.stringify({\n    data: encrypted,\n    iv: iv.toString('base64'),\n    tag: cipher.getAuthTag().toString('base64')\n  }));\n}\n\n/**\n * Decrypts the encrypted data using AES-256-GCM algorithm\n * @param {string} encdata\n * @param {string} key\n * @returns {string} Decrypted plainText\n */\nfunction decrypt(encdata, key) {\n  let decrypted, decipher,\n    {data, iv, tag} = JSON.parse(atob(encdata));\n\n  key = crypto.createHash('sha256').update(key).digest();\n\n  decipher = crypto.createDecipheriv('AES-256-GCM', key, Buffer.from(iv, 'base64'));\n  decipher.setAuthTag(Buffer.from(tag, 'base64'));\n\n  decrypted = decipher.update(data, 'base64', 'utf-8');\n  decrypted += decipher.final('utf-8');\n\n  return decrypted;\n}\n\n// Example usage:\nlet key = 'example-key'; // private key\n\nlet encMsg = encrypt('Your secret message?', key); // Outputs: eyJkYXRhIjoidzkzVGVPRDJwYzREUWVYUjRXeVJQU1FxWGZrPSIsIml2IjoiWlNpSVNmanNPcFBic0dvTGJUOUJDZz09IiwidGFnIjoiSkVFUDBBeGdkRUlnRVNyekNTZUJidz09In0=\ndecrypt(encMsg);                                   // Outputs: Your secret message?\n```\n\n### hasPassword and verifyPassword\n\n[![Shorts Views](https://img.shields.io/youtube/views/9_soeaSaccs?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/9_soeaSaccs)\n[![Shorts Likes](https://img.shields.io/youtube/likes/9_soeaSaccs?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/9_soeaSaccs)\n[![Shorts Comments](https://img.shields.io/youtube/comments/9_soeaSaccs?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/9_soeaSaccs)\n\nWatch video shorts on youtube click: [Watch Now](https://www.youtube.com/shorts/9_soeaSaccs)\n\n```js\nconst crypto = require('crypto');\n\n/**\n * Create a password hash with salt hashing SHA-256 algorithm\n * @param {string} password \n * @param {string} salt [optional]\n * @returns {string} Hashed Password\n */\nfunction hashPassword(password, salt) {\n  // Generate Salt\n  salt = salt || crypto.randomBytes(16).toString('hex');\n  let hash = salt + crypto.createHmac('sha256', salt).update(password).digest('hex');\n  return hash;\n}\n\n/**\n * Checks if the given hash matches the given options\n * @param {string} password \n * @param {string} hash \n * @returns {boolean} Verified for true Otherwise false\n */\nfunction verifyPassword(password, hash) {\n  // Extract salt from given hash\n  let salt = hash.slice(0, 32);\n  return hashPassword(password, salt) === hash;\n}\n\n// Example usage:\nlet hash = hashPassword('123@pass'); // Outputs: Random =\u003e 8d0f5aa4fdfec0895a9e796420ffb9eeb223c9f04777e96d8038591378a535f662edfd6f9e3a49c64ca423bc38106125\nverifyPassword('123@pass', hash);    // Outputs: true\nverifyPassword('123@Pass', hash);    // Outputs: false\nverifyPassword('pass@123', hash);    // Outputs: false\n```\n\n### toggleCase\n\n[![Shorts Views](https://img.shields.io/youtube/views/5kPF4bQecWU?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/5kPF4bQecWU)\n[![Shorts Likes](https://img.shields.io/youtube/likes/5kPF4bQecWU?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/5kPF4bQecWU)\n[![Shorts Comments](https://img.shields.io/youtube/comments/5kPF4bQecWU?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/5kPF4bQecWU)\n\nWatch video shorts on youtube click: [Watch Now](https://www.youtube.com/shorts/5kPF4bQecWU)\n\n```js\n/**\n * Converts a string with a specified separator into tOGGLE cASE format.\n * @param {string} str\n * @param {string} sep\n * @returns {string} tOGGLE cASE format\n */\nfunction toggleCase(str, sep = \" \") {\n  let regex = new RegExp(\"([^\" + sep + \"]+)\", \"g\");\n\n  // Converting str to tOGGLE cASE\n  return str.replace(regex, (_, w) =\u003e w[0].toLowerCase() + w.slice(1).toUpperCase());\n}\n\n// Example usage:\nlet str = 'Hello World hello:world hello_world';\n\ntoggleCase(str);        // Outputs: hELLO wORLD hELLO:WORLD hELLO_WORLD\ntoggleCase(str, ': _'); // Outputs: hELLO wORLD hELLO:wORLD hELLO_wORLD\ntoggleCase(str, ': _'); // Outputs: tOGGLE cASE\ntoggleCase(str, ':_');  // Outputs: hELLO WORLD HELLO:wORLD HELLO_wORLD\n```\n\n### generatePassword\n\n[![Shorts Views](https://img.shields.io/youtube/views/b9rw-DEwgj4?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/b9rw-DEwgj4)\n[![Shorts Likes](https://img.shields.io/youtube/likes/b9rw-DEwgj4?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/b9rw-DEwgj4)\n[![Shorts Comments](https://img.shields.io/youtube/comments/b9rw-DEwgj4?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/b9rw-DEwgj4)\n\nWatch video shorts on youtube click: [Watch Now](https://www.youtube.com/shorts/b9rw-DEwgj4)\n\n```js\n/**\n * Generates a Random strong password (e.g., CRsAB0f%XUGY)\n * @param {number} Password length\n * @returns The Random Password\n */\nfunction generatePassword(len) {\n  let chars = 'abcdefghijklmnopqrstuvwxyz',\n    num = 1234567890,\n    password = '',\n    i = 0;\n\n    // Concating num, Upper alpha and special chars\n    chars += num + chars.toUpperCase() + '!@#$%^\u0026*()';\n    len = +len || 8;\n\n  // Generating random password\n  for(; i \u003c len; i++) {\n    password += chars[Math.floor(Math.random() * chars.length)];\n  }\n\n  return password;\n}\n\n// Example usage:\ngeneratePassword();   // Outputs: CRsAB0f%XUGY\ngeneratePassword(12); // Outputs: ayrYcu%Pu$Ka\n```\n\n### findLongest and findShortest\n\n[![Shorts Views](https://img.shields.io/youtube/views/MDumTQ543O4?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/MDumTQ543O4)\n[![Shorts Likes](https://img.shields.io/youtube/likes/MDumTQ543O4?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/MDumTQ543O4)\n[![Shorts Comments](https://img.shields.io/youtube/comments/MDumTQ543O4?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/MDumTQ543O4)\n\nWatch video shorts on youtube click: [Watch Now](https://www.youtube.com/shorts/MDumTQ543O4)\n\n```js\n/**\n * Find the longest string value in an Array\n * @param {}\n * @returns The longest string\n */\nfunction findLongest(arr) {\n  return arr.reduce((max, val) =\u003e (\n    max.length \u003c val.length \u0026\u0026 (max = val),\n    max\n  ), arr[0] + '');\n}\n\n/**\n * Find the shortest string value in an Array\n * @param {}\n * @returns The shortest string\n */\nfunction findShortest(arr) {\n  return arr.reduce((min, val) =\u003e (\n    min.length \u003e val.length \u0026\u0026 (min = val),\n    min\n  ), arr[0] + '');\n}\n\n// Example usage:\nlet arr = ['Hello', 'How are you?', 'Welcome to you', 'Thanks'];\n\nfindLongest(arr);  // Outputs: Welcome to you\nfindShortest(arr); // Outputs: Hello\n```\n\n### strShuffle\n\n[![Shorts Views](https://img.shields.io/youtube/views/kOB_yygDwIY?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/kOB_yygDwIY)\n[![Shorts Likes](https://img.shields.io/youtube/likes/kOB_yygDwIY?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/kOB_yygDwIY)\n[![Shorts Comments](https://img.shields.io/youtube/comments/kOB_yygDwIY?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/kOB_yygDwIY)\n\nWatch video shorts on youtube click: [Watch Now](https://www.youtube.com/shorts/kOB_yygDwIY)\n\n```js\n/**\n * shuffles a string. One permutation of all possible is created.\n * @param {string} str The input string.\n * @returns {string} Randomly shuffles a string\n */\nfunction strShuffle(str) {\n  let arr = str.split(''),\n    i = arr.length - 1,\n    rIndex;\n\n  // Shuffle Algorithm\n  for(; i \u003e 0; i--) {\n    rIndex = Math.floor(Math.random() * (i + 1));\n\n    // Swap the current element with the random element\n    [arr[i], arr[rIndex]] = [arr[rIndex], arr[i]];\n  }\n\n  return arr.join('');\n}\n\n// Example usage:\nstrShuffle('Hello'); // Outputs: olelH\n```\n\n### jsonEncode and jsonDecode\n\n[![Shorts Views](https://img.shields.io/youtube/views/5uURC9ItBEQ?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/5uURC9ItBEQ)\n[![Shorts Likes](https://img.shields.io/youtube/likes/5uURC9ItBEQ?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/5uURC9ItBEQ)\n[![Shorts Comments](https://img.shields.io/youtube/comments/5uURC9ItBEQ?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/5uURC9ItBEQ)\n\nWatch video shorts on youtube click: [Watch Now](https://www.youtube.com/shorts/5uURC9ItBEQ)\n\n```\n/**\n * Converts a JavaScript value to a JavaScript Object Notation (JSON) string.\n * @param {any} value           [required]\n * @param {any} replacer        [optional]\n * @param {string|number} space [optional]\n * @returns {string} The JSON string representation of the object.\n */\nfunction jsonEncode(value, replacer, space) {\n  try {\n    return JSON.stringify(value, replacer, space);\n  } catch(e) {\n    throw new Error('Error encoding object: ' + e);\n  }\n}\n\n/**\n * Converts a JavaScript Object Notation (JSON) string into an object.\n * @param {string} json [required]\n * @param {any} reviver [optional]\n * @returns {object} The decoded Javascript object\n */\nfunction jsonDecode(json, reviver) {\n  try {\n    return JSON.parse(json, reviver);\n  } catch(e) {\n    throw new Error('Error decoding JSON: ' + e);\n  }\n}\n\n// Example usage with output:\n\nlet obj = {name: 'Modassir', age: 23, Indian: true};\n\n// Encoding the object to a JSON string\nlet json = jsonEncode(obj);  // Outputs: '{\"name\":\"Modassir\",\"age\":23,\"Indian\":true}'\n\n// Decoding the JSON string back to a JavaScript object\njsonDecode(json); // Outputs: {name: 'Modassir', age: 23, Indian: true}\n```\n\n### wordCount\n\n[![Shorts Views](https://img.shields.io/youtube/views/LkZgDWlKauU?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/LkZgDWlKauU)\n[![Shorts Likes](https://img.shields.io/youtube/likes/LkZgDWlKauU?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/LkZgDWlKauU)\n[![Shorts Comments](https://img.shields.io/youtube/comments/LkZgDWlKauU?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/LkZgDWlKauU)\n\nWatch video shorts on youtube click: [Watch Now](https://www.youtube.com/shorts/LkZgDWlKauU)\n\n```js\n/**\n * Return information about words used in a string\n * @param {string} str The string\n * @param {number} format Specify the return value of this function. The current supported values\n * @param {string} chars A list of additional characters which will be considered as 'word'\n * @returns Information about words\n */\nfunction wordCount(str, format = 0, chars) {\n  let regstr = new RegExp(\"([a-z-0-9\" + (chars || \"\") + \"]+)\", \"gi\"),\n    ret = [0, [], {}][format],\n    result;\n\n  while((result = regstr.exec(str))) {\n    if (format === 0) ret++;\n    else if (format === 1) ret.push(result[0]);\n    else ret[result.index] = result[0];\n  }\n\n  return ret;\n}\n\n// Example usage:\nlet str = 'one:two three-four five_six seven$eight nine%ten';\n\nwordCount(str);           // Outputs: 9\nwordCount(str, 0, '$:%'); // Outputs: 6\nwordCount(str, 1);        // Outputs: ['one', 'two', 'three-four', 'five', 'six', 'seven','eight', 'nine', 'ten']\nwordCount(str, 1, '$:%'); // Outputs: [ 'one:two', 'three-four', 'five', 'six', 'seven$eight', 'nine%ten' ]\nwordCount(str, 2);        // Outputs: {'0': 'one','4': 'two','8': 'three-four','19': 'five','24': 'six','28': 'seven','34': 'eight','40': 'nine','45': 'ten'}\nwordCount(str, 2, '$:%'); // Outputs: {'0': 'one:two','8': 'three-four','19': 'five','24': 'six','28': 'seven$eight','40': 'nine%ten'}\n```\n\n### speech2text\n\n[![Shorts Views](https://img.shields.io/youtube/views/zW_zEscP1bU?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/zW_zEscP1bU)\n[![Shorts Likes](https://img.shields.io/youtube/likes/zW_zEscP1bU?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/zW_zEscP1bU)\n[![Shorts Comments](https://img.shields.io/youtube/comments/zW_zEscP1bU?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/zW_zEscP1bU)\n\nWatch video shorts on youtube click: [Watch Now](https://www.youtube.com/shorts/zW_zEscP1bU)\n\n```js\n/**\n* Text to Speech using SpeechSynthesisUtterance and SpeechSynthesis API\n* @param {string} text target text for speech\n*/\nfunction text2speech(text) {\n let speech = new window.SpeechSynthesisUtterance(text),\n   synthesis = window.speechSynthesis;\n\n // Optional: Set language of speech\n speech.lang = 'en-US';\n\n // Optional: Set pitch and rate of speech\n speech.pitch = 1;\n speech.rate = 1;\n \n // Start speech\n synthesis.speak(speech);\n}\n\n// Example usage:\nspeech2text('Hello viewers, how are you?');\n```\n\n### cmdout\n\n[![Shorts Views](https://img.shields.io/youtube/views/rdfFyUhKUys?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/rdfFyUhKUys)\n[![Shorts Likes](https://img.shields.io/youtube/likes/rdfFyUhKUys?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/rdfFyUhKUys)\n[![Shorts Comments](https://img.shields.io/youtube/comments/rdfFyUhKUys?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/rdfFyUhKUys)\n\nWatch video shorts on youtube click: [Watch Now](https://www.youtube.com/shorts/rdfFyUhKUys)\n\n```js\n/**\n * cmdout To highlight text or background color in cmd/terminal\n * @param {string} text Target text to highlight\n * @param {boolean} setBg true for background otherwise text highlight\n * @param {boolean} bold true for bold otherwise normal\n * @param {array} color Don't use, Internal use only [private]\n * @returns The highlightable text format\n */\nfunction cmdout(text, setBg, bold, color) {\n  let ansi = `\\x1b[${setBg ? 48 : 38};2;${color.join(';')}m`;\n\n  if (bold) ansi = `\\x1b[1m${ansi}`;\n  if (setBg) text = `\\x20${text}\\x20`;\n\n  return `${ansi}${text}\\x1b[0m`;\n}\n\nObject.assign(cmdout, {\n  blue: function(text, setBg, bold) {\n    return cmdout(text, setBg, bold, [8, 48, 218]);\n  },\n  green: function(text, setBg, bold) {\n    return cmdout(text, setBg, bold, [19, 161, 14]);\n  },\n  aqua: function(text, setBg, bold) {\n    return cmdout(text, setBg, bold, [58, 150, 221]);\n  },\n  red: function(text, setBg, bold) {\n    return cmdout(text, setBg, bold, [197, 15, 31]);\n  },\n  purple: function(text, setBg, bold) {\n    return cmdout(text, setBg, bold, [136, 23, 152]);\n  },\n  yellow: function(text, setBg, bold) {\n    return cmdout(text, setBg, bold, [193, 156, 0]);\n  },\n  white: function(text, setBg, bold) {\n    return cmdout(text, setBg, bold, [204, 204, 204]);\n  },\n  gray: function(text, setBg, bold) {\n    return cmdout(text, setBg, bold, [118, 118, 118]);\n  }\n});\n\n// Example usage:\ncmdout.yellow('Like', true, true) + cmdout.blue('Subscribe', true, true); // Outputs:\ncmdout.red('Hello World!', false, true);                                  // Outputs:\ncmdout.red('Hello World!', true, true);                                   // Outputs:\ncmdout.yellow('Hello World!', false, true);                               // Outputs:\ncmdout.yellow('Hello World!', true, true);                                // Outputs:\ncmdout.blue('Hello World!', false, true);                                 // Outputs:\ncmdout.red('Thanks', true, true) + cmdout.yellow('Watching', true, true); // Outputs:\n```\n\n### getType\n\n[![Shorts Views](https://img.shields.io/youtube/views/i2azCn225nE?style=flat-square\u0026logo=youtube)](https://youtube.com/shorts/i2azCn225nE)\n[![Shorts Likes](https://img.shields.io/youtube/likes/i2azCn225nE?style=flat-square\u0026logo=youtube)](https://youtube.com/shorts/i2azCn225nE)\n[![Shorts Comments](https://img.shields.io/youtube/comments/i2azCn225nE?style=flat-square\u0026logo=youtube)](https://youtube.com/shorts/i2azCn225nE)\n\nWatch video shorts on youtube click: [Watch Now](https://youtube.com/shorts/i2azCn225nE)\n\n```js\n/**\n * getType function determines the precise type of the input value.\n * @param {any} data [required]\n * @returns {string} precise type of value as a lowercase string.\n */\nfunction getType(data) {\n  let type, class2type = {};\n\n  if (data == null) {\n    return data + '';\n  }\n\n  // Populate class2type map\n  for(type of (\"Boolean Number String Function Array Date RegExp Object Error Symbol\").split(\" \")) {\n    class2type['[object ' + type + ']'] = type.toLowerCase();\n  }\n  \n  return typeof data === \"function\" || typeof data === \"object\" ?\n    class2type[toString.call(data)] || \"object\" :\n      typeof data;\n}\n\n// Example usage:\ngetType(new Error('Something wrong!')); // Outputs: error\ngetType('Hello World!');                // Outputs: string\ngetType(function() {});                 // Outputs: function\ngetType(/[A-Z0-9]/);                    // Outputs: regexp\ngetType(Symbol('Hello World!'));        // Outputs: symbol\n```\n\n### base64Encode and base64Decode\n\n[![Shorts Views](https://img.shields.io/youtube/views/Th9muTd5Lck?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/Th9muTd5Lck)\n[![Shorts Likes](https://img.shields.io/youtube/likes/Th9muTd5Lck?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/Th9muTd5Lck)\n[![Shorts Comments](https://img.shields.io/youtube/comments/Th9muTd5Lck?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/Th9muTd5Lck)\n\nWatch video shorts on youtube click: [Watch Now](https://www.youtube.com/shorts/Th9muTd5Lck)\n\n```js\n/**\n * Encode a string to Base64\n */\nfunction base64Encode(string) {\n  return btoa(string);\n}\n\n/**\n * Decode a Base64-encoded string\n */\nfunction base64Decode(string) {\n  return atob(string);\n}\n\n// Example usage:\nbase64Encode('Hello, World!');       // Outputs: SGVsbG8sIFdvcmxkIQ==\nbase64Decode('SGVsbG8sIFdvcmxkIQ==') // Outputs: Hello, World!;\n```\n\n### dashCase\n\n[![Shorts Views](https://img.shields.io/youtube/views/Jr5pLw2ayjY?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/Jr5pLw2ayjY)\n[![Shorts Likes](https://img.shields.io/youtube/likes/Jr5pLw2ayjY?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/Jr5pLw2ayjY)\n[![Shorts Comments](https://img.shields.io/youtube/comments/Jr5pLw2ayjY?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/Jr5pLw2ayjY)\n\nWatch video shorts on youtube click: [Watch Now](https://www.youtube.com/shorts/Jr5pLw2ayjY)\n\n```js\n/**\n * Converts a string with a specified separator into dashCase format.\n * @param {string} str input string\n * @param {string} sep The character\n * @returns dashCase format.\n */\n function dashCase(str, sep) {\n  let rAlpha = new RegExp('[' + (sep || '_ ') + ']+([A-Za-z])|([A-Z])', 'g');\n\n  return str.replace(rAlpha, '-$1$2').toLowerCase().replace(/^-/, '');\n}\n\n// Example usage:\ndashCase('textTransform'); // Outputs: text-transform\ndashCase('Hello World');   // Outputs: hello-world\ndashCase('hello_world');   // Outputs: hello-world\ndashCase('dd:mm:yy', ':'); // Outputs: dd-mm-yy\n```\n\n### camelCase\n\n[![Shorts Views](https://img.shields.io/youtube/views/UW-Mx0riyqc?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/UW-Mx0riyqc)\n[![Shorts Likes](https://img.shields.io/youtube/likes/UW-Mx0riyqc?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/UW-Mx0riyqc)\n[![Shorts Comments](https://img.shields.io/youtube/comments/UW-Mx0riyqc?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/UW-Mx0riyqc)\n\nWatch video shorts on youtube click: [Watch Now](https://www.youtube.com/shorts/UW-Mx0riyqc)\n\n```js\n/**\n * Converts a string with a specified separator into camelCase format.\n * @param {string} str input string\n * @param {string} sep The character\n * @returns camelCase format.\n */\nfunction camelCase(str, sep) {\n  let rdashAlpha = new RegExp('[' + (sep || '-') + ']([a-z])', 'g');\n\n  return str.toLowerCase().replace(rdashAlpha, function(_, char) {\n    return char.toUpperCase();\n  });\n}\n\n// Example usage:\ncamelCase('font-size: 11px;'); // Outputs: fontSize: 11px;\ncamelCase('hello woRld', ' '); // Outputs: helloWorld\ncamelCase('hello_world', '_'); // Outputs: helloWorld\n```\n\n### ArrayDiff\n\n[![Shorts Views](https://img.shields.io/youtube/views/cVXjK_8mxGM?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/cVXjK_8mxGM)\n[![Shorts Likes](https://img.shields.io/youtube/likes/cVXjK_8mxGM?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/cVXjK_8mxGM)\n[![Shorts Comments](https://img.shields.io/youtube/comments/cVXjK_8mxGM?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/cVXjK_8mxGM)\n\nWatch video shorts on youtube click: [Watch Now](https://www.youtube.com/shorts/cVXjK_8mxGM)\n\n```js\n/**\n * ArrayDiff Computes the difference of array\n * @params {array} arr\n * @params {array} target\n * @returns The Computed array\n */\nfunction ArrayDiff(arr, target) {\n  let i = 0, output = [];\n\n  for(; i \u003c arr.length; i++) {\n    if (arr.indexOf.call(target, arr[i]) \u003c 0) {\n      output.push(arr[i]);\n    }\n  }\n  return output;\n}\n\n// Example usage:\nconst arr1 = [100,200,300,400,500];\nconst arr2 = ['.','..','src/example.txt','.env'];\n\nArrayDiff(arr1, [100,300,500]); // Outputs: [200, 400]\nArrayDiff(arr2, ['.', '..']);   // Outputs: ['src/example.txt', '.env']\n```\n\n### Dotenv\n\n[![Shorts Views](https://img.shields.io/youtube/views/bBddXbiPjFo?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/bBddXbiPjFo)\n[![Shorts Likes](https://img.shields.io/youtube/likes/bBddXbiPjFo?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/bBddXbiPjFo)\n[![Shorts Comments](https://img.shields.io/youtube/comments/bBddXbiPjFo?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/bBddXbiPjFo)\n\nWatch video shorts on youtube click: [Watch Now](https://www.youtube.com/shorts/bBddXbiPjFo)\n\n**Step1:** Create a environment file `.env` in current directory.\n\n```conf\nDB_CONNECTION=mysql\nDB_HOST=localhost\nDB_PORT=3306\nDB_USERNAME=root\nDB_PASSWORD=\nDB_DATABASE=localdb\n```\n\n**Step2:** Create a main Dotenv loader file `Dotenv.js`\n```js\n/**\n * Dotenv To loads environment variables\n */\nconst path = require('path');\nconst fs = require('fs');\n\nconst ENV = /^[\\x20]*(\\w+)[\\x20]*=[\\x20]*(?:([\"'`])((?:[^\\r\\n]|[\\r\\n])*?)(\\2)|([^#\\r\\n]*))(?!^#)/gm;\n\nfunction Dotenv(dir, name) {\n  if (!(this instanceof Dotenv)) {\n    return new Dotenv(dir, name);\n  }\n\n  let matched, filePath = path.resolve(dir, name),\n    content = fs.readFileSync(filePath, {encoding: 'utf-8'});\n\n  this.entries = {};\n\n  while((matched = ENV.exec(content))) {\n    this.entries[matched[2]] = matched[5] || matched[3] || '';\n  }\n\n  return this;\n}\n\nDotenv.prototype.load = function() {\n  Object.assign(process.env, this.entries);\n};\n\nmodule.exports = Dotenv;\n```\n\n**Step3:** Create a usage file where want to loads env variables LIKE `dotenv.test.js`\n\n```js\nconst Dotenv = require('./dotenv');\n\nDotenv(__dirname, '.env').load();\n\nprocess.env.DB_CONNECTION  // Outputs: mysql\nprocess.env.DB_HOST        // Outputs: localhost\nprocess.env.DB_PORT        // Outputs: 3306\nprocess.env.DB_USERNAME    // Outputs: root\nprocess.env.DB_PASSWORD    // Outputs: ''\nprocess.env.DB_DATABASE    // Outputs: localdb\n```\n\n### rgb2hex\n\n[![Shorts Views](https://img.shields.io/youtube/views/EbVut1Q0RUE?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/EbVut1Q0RUE)\n[![Shorts Likes](https://img.shields.io/youtube/likes/EbVut1Q0RUE?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/EbVut1Q0RUE)\n[![Shorts Comments](https://img.shields.io/youtube/comments/EbVut1Q0RUE?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/EbVut1Q0RUE)\n\nWatch video shorts on youtube click: [Watch Now](https://www.youtube.com/shorts/EbVut1Q0RUE)\n\n```js\n/**\n * Convert RGB/RGBA color format to HEX color format\n * @param {string} rgb [required]\n * @returns Hex color code (e.g., #ff121789, #2727c9)\n */\nfunction rgb2hex(rgb) {\n  var i, a, p, rgba,\n    regRgb = /^(?:rgb)(a)?\\((?:(?\u003cr\u003e[\\d]{1,3})([,\\x20])(?\u003cg\u003e[\\d]{1,3})\\3(?\u003cb\u003e[\\d]{1,3}))(?:(?=\\3)[^,]\\/\\x20?(?\u003ca\u003e[\\d]{1,3}(?:\\.\\d+)?)(?\u003cp\u003e%)|(?=\\3),(?\u003cA\u003e0?\\.\\d+))?\\)/g,\n    regCwp = /(?:(,)\\x20*|(\\x20)[\\x20]*|;)/g,\n    hex = \"#\";\n\n  if (!(rgba = (regRgb.exec(rgb.replace(regCwp, \"$1$2\")) || {}).groups)) {\n    throw new Error(\"Invalid rgb format: \" + rgb);\n  }\n\n  // Extract RGB values\n  rgb = [rgba.r, rgba.g, rgba.b];\n  p = !!rgba.p; // If alpha value in %percent\n  a = +(rgba.A || rgba.a); // alpha value\n\n  // Convert RGB to HEX\n  for(i in rgb) {\n    hex += (+rgb[i]).toString(16).padStart(2, '0');\n  }\n\n  if (p) a /= 100;\n\n  // Convert Alpha to HEX\n  if (a) {\n    hex += Math.round(a * 255).toString(16).padStart(2, '0');\n  }\n\n  return hex;\n}\n\n// Example usage:\nrgb2hex(\"rgba(255, 22, 17, .3)\"); // Outputs: #ff16114d\nrgb2hex(\"rgb(255, 18, 23, 0.5)\");   // Outputs: #ff121789\nrgb2hex(\"rgb(39 39 201)\");          // Outputs: #2727c9\nrgb2hex(\"rgb(255 33 56 / 38%)\");    // Outputs: #ff213861\n```\n\n### hex2rgb\n\n[![Shorts Views](https://img.shields.io/youtube/views/PWoz2zaftJM?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/PWoz2zaftJM)\n[![Shorts Likes](https://img.shields.io/youtube/likes/PWoz2zaftJM?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/PWoz2zaftJM)\n[![Shorts Comments](https://img.shields.io/youtube/comments/PWoz2zaftJM?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/PWoz2zaftJM)\n\nWatch video shorts on youtube click: [Watch Now](https://www.youtube.com/shorts/PWoz2zaftJM)\n\n```js\n/**\n * Convert HEX color format to RGB/RGBA color Format\n * @param {string} hex [required]\n * @returns rgb/rgba format (e.g., 'rgba(255,123,238)')\n */\nfunction hex2rgb(hex) {\n  let i = 0, rgba = [];\n  \n  hex = hex.replace(/^#/, \"\");\n\n  // If the hex color is 3 characters (shorthand), expand it to 6 characters\n  if (hex.length === 3) {\n    hex = hex.replace(/(?=(.))/g, \"$1\");\n  }\n\n  // Extract the RGB values\n  for(; i \u003c 6; i += 2) {\n    rgba.push(parseInt(hex.slice(i, i + 2), 16));\n  }\n\n  // Extract the Alpha value\n  if (hex.length === 8) {\n    rgba.push((parseInt(hex.slice(i, i + 2), 16) / 255).toFixed(2));\n  }\n\n  return 'rgba(' + rgba.join(',') + ')';\n}\n\n// Example usage:\nhex2rgb(\"#ffff0080\"); // Outputs: rgba(255,255,0,0.50)\nhex2rgb(\"#eeeeee\");   // Outputs: rgba(238,238,238)\nhex2rgb(\"#fff\");      // Outputs: rgba(255,255,255)\nhex2rgb(\"#777bb3\");   // Outputs: rgba(119,123,179)\nhex2rgb(\"#ff00ff80\"); // Outputs: rgba(255,0,0.50)\n```\n\n### objChangeKeyCase\n\n[![Shorts Views](https://img.shields.io/youtube/views/vBlEkGJcdEg?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/vBlEkGJcdEg)\n[![Shorts Likes](https://img.shields.io/youtube/likes/vBlEkGJcdEg?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/vBlEkGJcdEg)\n[![Shorts Comments](https://img.shields.io/youtube/comments/vBlEkGJcdEg?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/vBlEkGJcdEg)\n\nWatch video shorts on youtube click: [Watch Now](https://www.youtube.com/shorts/vBlEkGJcdEg)\n\n```js\n/**\n * Changes the case of all keys in an object\n * @param {object} obj\n * @param {boolean} isUpper\n * @returns Returns an object with its keys lower or uppercased\n */\nfunction objChangeKeyCase(obj, isUpper) {\n  let Case = 'to' + (isUpper ? 'Upper' : 'Lower') + 'Case';\n\n  return Object.fromEntries(\n    Object.entries(obj)\n    .map(([key, val]) =\u003e [key[Case](), val])\n  );\n}\n\n// Example usage:\nconst obj = {First: 1, SecOnd: 2, ThirD: 3, FOURTH: 4, fifth: 5};\n\nobjChangeKeyCase(obj, true); // Outputs: {FIRST: 1, SECOND: 2, THIRD: 3, FOURTH: 4, FIFTH: 5}\nobjChangeKeyCase(obj);       // Outputs: {first: 1, second: 2, third: 3, fourth: 4, fifth: 5}\n```\n\n### Filter odd \u0026 even\n\n[![Shorts Views](https://img.shields.io/youtube/views/-0XRodnoeoc?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/-0XRodnoeoc)\n[![Shorts Likes](https://img.shields.io/youtube/likes/-0XRodnoeoc?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/-0XRodnoeoc)\n[![Shorts Comments](https://img.shields.io/youtube/comments/-0XRodnoeoc?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/-0XRodnoeoc)\n\nWatch video shorts on youtube click: [Watch Now](https://www.youtube.com/shorts/-0XRodnoeoc)\n\n```js\n/**\n * odd — Filter odd values in an array\n * @param {array} arr\n * @returns array with odd values\n */\nfunction odd(arr) {\n  return arr.filter(num =\u003e num % 2);\n}\n\n/**\n * even — Filter even values in an array\n * @param {array} arr\n * @returns array with even values\n */\nfunction even(arr) {\n  return arr.filter(num =\u003e (num + 1) % 2);\n}\n\n// Example usage:\nlet arr = [1,2,3,4,5,6,7,8,9];\nodd(arr);  // Outputs: [1,3,5,7,9]\neven(arr); // Outputs: [2,4,6,8]\n```\n\n### array_combine\n\n[![Shorts Views](https://img.shields.io/youtube/views/cl15TBx0kcE?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/cl15TBx0kcE)\n[![Shorts Likes](https://img.shields.io/youtube/likes/cl15TBx0kcE?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/cl15TBx0kcE)\n[![Shorts Comments](https://img.shields.io/youtube/comments/cl15TBx0kcE?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/cl15TBx0kcE)\n\nWatch video shorts on youtube click: [Watch Now](https://www.youtube.com/shorts/cl15TBx0kcE)\n\n```js\n/**\n * array_combine — Creates an object by using one array for keys\n * and another for its values\n */\nArray.prototype.combine = function(values) {\n  return array_combine(this, values);\n};\n\n/**\n * array_combine — Creates an object by using one array for keys\n * and another for its values\n * \n * @param {array} keys\n * @param {array} values\n * @returns Combined object with keys and values\n */\nfunction array_combine(keys, values) {\n  if (keys.length !== values.length) {\n    throw new Error('array_combine method require must have the same number of elements.');\n  }\n\n  return values.reduce((comb, val, i) =\u003e (comb[keys[i]] = val, comb), {});\n}\n\n// Example usage:\nconst keys = ['IN','US','RU'];\nconst values = ['India','United States','Russia'];\n\nkeys.combine(values);        // Outputs: {IN: 'India', US: 'United States', RU: 'Russia'}\narray_combine(keys, values); // Outputs: {IN: 'India', US: 'United States', RU: 'Russia'}\n```\n\n### object_flip\n\n[![Shorts Views](https://img.shields.io/youtube/views/pf4qjxGMamM?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/pf4qjxGMamM)\n[![Shorts Likes](https://img.shields.io/youtube/likes/pf4qjxGMamM?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/pf4qjxGMamM)\n[![Shorts Comments](https://img.shields.io/youtube/comments/pf4qjxGMamM?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/pf4qjxGMamM)\n\nWatch video shorts on youtube click: [Watch Now](https://www.youtube.com/shorts/pf4qjxGMamM)\n\n```js\n/**\n * object_flip — Exchanges all keys with their object values in\n * an array or object in Javascript\n */\nObject.prototype.flip = function() {\n  return object_flip(this);\n};\n\n/**\n * object_flip — Exchanges all keys with their object values in\n * an array or object in Javascript\n * \n * @param {array|object} obj\n * @returns flipped object\n */\nfunction object_flip(obj) {\n  return Object.entries(obj).reduce((flip, [key, value]) =\u003e (flip[value] = key, flip), {});\n}\n\n// Example usage:\nconst ext1 = ['zero','one','two','three','four'];\nconst ext2 = {IN: 'India', US: 'United States'};\n\next1.flip();       // Outputs: {zero: 0, one: 1, two: 2, three: 3, four: 4}\nobject_flip(ext1); // Outputs: {zero: 0, one: 1, two: 2, three: 3, four: 4}\n\next2.flip();       // Outputs: {India: 'IN', 'United States': 'US'}\nobject_flip(ext2); // Outputs: {India: 'IN', 'United States': 'US'}\n```\n\n### ucwords \u0026 lcwords\n\n[![Shorts Views](https://img.shields.io/youtube/views/9eelNb2oh8w?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/9eelNb2oh8w)\n[![Shorts Likes](https://img.shields.io/youtube/likes/9eelNb2oh8w?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/9eelNb2oh8w)\n[![Shorts Comments](https://img.shields.io/youtube/comments/9eelNb2oh8w?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/9eelNb2oh8w)\n\nWatch video shorts on youtube click: [Watch Now](https://www.youtube.com/shorts/9eelNb2oh8w)\n\n```js\n/**\n * Creates an ucwords method in Javascript,\n * To UpperCase the first character of each word in a string\n */\nString.prototype.ucwords = function(separator) {\n  return toWords(this, separator, true);\n};\n\n/**\n * Creates an lcwords method in Javascript,\n * To LowerCase the first character of each word in a string\n */\nString.prototype.lcwords = function(separator) {\n  return toWords(this, separator, false);\n};\n\n/**\n * @internal\n * Uppercase or Lowercase the first character of each word in a string\n * @param {string}  str\n * @param {string}  separator\n * @param {boolean} isUpper\n * @returns Uppercase or Lowercase first character of each word\n */\nfunction toWords(str, separator, isUpper) {\n  let rChar = /(?=[^\\w\\s])/g,\n    matcher,\n    regex,\n    switchCase = function(char) {\n      return isUpper ? char.toUpperCase() : char.toLowerCase();\n    };\n\n  str = switchCase(str[0]) + str.slice(1);\n  separator = separator != null \u0026\u0026 separator.replace(rChar, \"\\\\\") || \"\\\\x20\\\\t\\\\r\\\\n\\\\f\\\\v\";\n  matcher = \"(?\u003c=[\" + separator + \"])\";\n  regex = new RegExp(matcher.concat(\"(.)\"), \"g\");\n  \n  return str.replace(regex, function(_, char) {\n    return switchCase(char);\n  });\n}\n\n// Example usage:\nconst str1 = 'hello world!, hello-world!, hello_world!';\nconst str2 = str1.toUpperCase();\n\nstr1.ucwords();      // Outputs: 'Hello World!, Hello-world!, Hello_world!'\nstr1.lcwords();      // Outputs: 'hELLO wORLD!, hELLO-WORLD!, hELLO_WORLD!'\n\nstr1.ucwords(' -_'); // Outputs: 'Hello World!, Hello-World!, Hello_World!'\nstr1.lcwords(' -_'); // Outputs: 'hELLO wORLD!, hELLO-wORLD!, hELLO_wORLD!'\n```\n\n### array_sum\n\n[![Shorts Views](https://img.shields.io/youtube/views/4Lw47y9cFF4?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/4Lw47y9cFF4)\n[![Shorts Likes](https://img.shields.io/youtube/likes/4Lw47y9cFF4?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/4Lw47y9cFF4)\n[![Shorts Comments](https://img.shields.io/youtube/comments/4Lw47y9cFF4?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/4Lw47y9cFF4)\n\nWatch video shorts on youtube click: [Watch Now](https://www.youtube.com/shorts/4Lw47y9cFF4)\n\n```js\n/**\n * Calculate the sum of values in array\n */\nArray.prototype.sum = function() {\n  return array_sum(this);\n};\n\n/**\n * Calculate the sum of values in array\n * @param {array} arr\n * @return Calculated sum values\n */\nfunction array_sum(arr) {\n  return arr.reduce(function(sum, cur) {\n    return sum + (parseFloat(cur) || 0);\n  }, 0);\n}\n\n// Example usage:\nconst arr = [1,2,3,'1px','2px','50%','100%','22.345',445.34];\n\narr.sum();      // Outputs: 626.685\narray_sum(arr); // Outputs: 626.685\n```\n\n### array_product\n\n[![Shorts Views](https://img.shields.io/youtube/views/9tHOal2FX_k?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/9tHOal2FX_k)\n[![Shorts Likes](https://img.shields.io/youtube/likes/9tHOal2FX_k?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/9tHOal2FX_k)\n[![Shorts Comments](https://img.shields.io/youtube/comments/9tHOal2FX_k?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/9tHOal2FX_k)\n\nWatch video shorts on youtube click: [Watch Now](https://www.youtube.com/shorts/9tHOal2FX_k)\n\n```js\n/**\n * Calculate the product of values in array\n */\nArray.prototype.product = function() {\n  return array_product(this);\n};\n\n/**\n * Calculate the product of values in array\n * @param {array} arr\n * @return Calculated product values\n */\nfunction array_product(arr) {\n  return arr.reduce(function(product, cur) {\n    return (product * (parseFloat(cur) || 0)).toFixed(2);\n  }, 1);\n}\n\n// Example usage:\nconst arr = [1,2,3,'3px','5px','55.23%','32.44'];\n\narr.product();      // Outputs: 161249.51\narray_product(arr); // Outputs: 161249.51\n```\n\n### max \u0026 min\n\n[![Shorts Views](https://img.shields.io/youtube/views/X3QqTG3W6E0?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/X3QqTG3W6E0)\n[![Shorts Likes](https://img.shields.io/youtube/likes/X3QqTG3W6E0?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/X3QqTG3W6E0)\n[![Shorts Comments](https://img.shields.io/youtube/comments/X3QqTG3W6E0?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/X3QqTG3W6E0)\n\nWatch video shorts on youtube click: [Watch Now](https://www.youtube.com/shorts/X3QqTG3W6E0)\n\n```js\n/**\n * min — Array to look through or first value to compare Find lowest value\n * @param {array} arr\n * @returns lowest value\n */\nfunction min(arr) {\n  return Math.min.apply(null, arr);\n}\n\n/**\n * max — Array to look through or first value to compare Find heighest value\n * @param {array} arr\n * @returns heighest value\n */\nfunction max(arr) {\n  return Math.max.apply(null, arr);\n}\n\n// Example usage:\nconst arr = [100,343,232,433,54544,33,3343,23];\nmin(arr); // Outputs: 23\nmax(arr); // Outputs: 54544\n```\n\n### randomEmoji\n\n[![Shorts Views](https://img.shields.io/youtube/views/1UZ9Io92YDA?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/1UZ9Io92YDA)\n[![Shorts Likes](https://img.shields.io/youtube/likes/1UZ9Io92YDA?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/1UZ9Io92YDA)\n[![Shorts Comments](https://img.shields.io/youtube/comments/1UZ9Io92YDA?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/1UZ9Io92YDA)\n\nWatch video shorts on youtube click: [Watch Now](https://www.youtube.com/shorts/1UZ9Io92YDA)\n\n```js\n/**\n * @function randomEmoji To Generates a random emoji\n * @returns Random Emoji (e.g., 😴, 😍, 😯)\n */\nfunction randomEmoji() {\n  let startCodePoint = 0x1F601,\n    endCodePoint = 0x1F64F,\n    emoji = [];\n\n  for(; startCodePoint \u003c endCodePoint; startCodePoint++) {\n    emoji.push(String.fromCodePoint(startCodePoint));\n  }\n\n  return emoji[\n    Math.floor(Math.random() * emoji.length)\n  ];\n}\n\n// Example usage:\nrandomEmoji(); // Outputs: 😍\n```\n\n### randomEmail\n\n[![Shorts Views](https://img.shields.io/youtube/views/XYLPpxCsHO8?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/XYLPpxCsHO8)\n[![Shorts Likes](https://img.shields.io/youtube/likes/XYLPpxCsHO8?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/XYLPpxCsHO8)\n[![Shorts Comments](https://img.shields.io/youtube/comments/XYLPpxCsHO8?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/XYLPpxCsHO8)\n\nWatch video shorts on youtube click: [Watch Now](https://www.youtube.com/shorts/XYLPpxCsHO8)\n\n```js\n/**\n * randomEmail — Generates a random fake email\n * @param {string} domain [optional]\n * @returns random fake email address\n */\nfunction randomEmail(domain) {\n  let suffix = Math.floor(Math.random() * Math.pow(4, 6)),\n    alpha = 'abcdefghijklmnopqrstuvwxyz',\n    username = '',\n    i = 0;\n\n  domain = suffix + '@' + (domain || 'gmail.com');\n\n  for(; i \u003c 12; i++) {\n    username += alpha[Math.floor(Math.random() * alpha.length)];\n  }\n\n  return username + domain;\n}\n\n// Example usage:\nrandomEmail();           // Outputs: 'psskyxrmtyve762@gmail.com'\nrandomEmail('user.com'); // Outputs: 'psskyxrmtyve762@user.com'\n```\n\n### dateFormat\n\n[![Shorts Views](https://img.shields.io/youtube/views/hBXIMoK1Fmo?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/hBXIMoK1Fmo)\n[![Shorts Likes](https://img.shields.io/youtube/likes/hBXIMoK1Fmo?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/hBXIMoK1Fmo)\n[![Shorts Comments](https://img.shields.io/youtube/comments/hBXIMoK1Fmo?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/hBXIMoK1Fmo)\n\nWatch video shorts on youtube click: [Watch Now](https://www.youtube.com/shorts/hBXIMoK1Fmo)\n\n```js\n/**\n * dateFormat — Create a Local date/time formatter\n * @param {string} format\n * @return Formatted Local date/time\n */\nfunction dateFormat(format) {\n  var rformat = /(?\u003c!\\\\)[dLmntyYhHgGisaA]|\\\\([a-z])/g,\n\n    date = new Date(),\n    n = date.getMonth() + 1,\n    Y = date.getFullYear(),\n    i = date.getMinutes(),\n    G = date.getHours(),\n    s = date.getSeconds(),\n\n    formats = {G, n, Y,\n      t: new Date(Y, n, 0).getDate(),\n      s: s \u003c= 9 ? s + '0' : s,\n      L: date.getDate(),\n      g: G % 12 || 12,\n      i: i \u003c= 9 ? i + '0' : i,\n      a: G \u003e= 12 ? 'pm' : 'am'\n    };\n\n  Object.assign(formats, {\n    H: (formats.G \u003c= 9 ? '0' : '') + formats.G,\n    h: (formats.g \u003c= 9 ? '0' : '') + formats.g,\n    m: (formats.n \u003c= 9 ? '0' : '') + formats.n,\n    d: (formats.L \u003c= 9 ? '0' : '') + formats.L,\n    y: formats.Y % 100,\n    A: formats.a.toUpperCase()\n  });\n\n  return format.replace(rformat, function(f, c) {\n    return c || formats[f];\n  });\n}\n\n// Example usage:\ndateFormat('d-m-y h:i:s a'); // Outputs: 09-12-24 11:45:48 pm\ndateFormat('d-m-Y h:i:s A'); // Outputs: 09-12-2024 11:45:48 PM\ndateFormat('L n Y H:i:s A'); // Outputs: 9 12 2024 23:45:48 PM\ndateFormat('d/m/Y');         // Outputs: 09/12/2024\ndateFormat('H:i:s A');       // Outputs: 23:45:48 PM\ndateFormat('h');             // Outputs: 11 hours\ndateFormat('i');             // Outputs: 45 minutes\ndateFormat('s');             // Outputs: 48 seconds\ndateFormat('a');             // Outputs: pm\ndateFormat('d/m/Y h:i:s');   // Outputs: 09/12/2024 11:45:48\n```\n\n### generateIP\n\n[![Shorts Views](https://img.shields.io/youtube/views/aLW3bmSRAKs?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/aLW3bmSRAKs)\n[![Shorts Likes](https://img.shields.io/youtube/likes/aLW3bmSRAKs?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/aLW3bmSRAKs)\n[![Shorts Comments](https://img.shields.io/youtube/comments/aLW3bmSRAKs?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/aLW3bmSRAKs)\n\nWatch video shorts on youtube click: [Watch Now](https://www.youtube.com/shorts/aLW3bmSRAKs)\n\n```js\n/**\n * generateIP — Generate random fake IP address\n * @returns Random fake IP address\n */\nfunction generateIP() {\n  var i = 0, ip = '';\n\n  for(; i \u003c 4; i++) {\n    ip += Math.floor(Math.random() * 256);\n    if (i \u003c 3) ip += '.';\n  }\n  return ip;\n}\n\n// Example usage:\ngenerateIP(); // Outputs: '131.167.104.164'\n```\n\n### getFlag\n\n[![Shorts Views](https://img.shields.io/youtube/views/YGGHUDv3pvw?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/YGGHUDv3pvw)\n[![Shorts Likes](https://img.shields.io/youtube/likes/YGGHUDv3pvw?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/YGGHUDv3pvw)\n[![Shorts Comments](https://img.shields.io/youtube/comments/YGGHUDv3pvw?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/YGGHUDv3pvw)\n\nWatch video shorts on youtube click: [Watch Now](https://www.youtube.com/shorts/YGGHUDv3pvw)\n\n```js\n/**\n * getFlag — To create a country flag generator using regional indicator symbols\n * @param {string} code\n * @return country flag\n */\nfunction getFlag(code) {\n  return code.replace(/[a-z]/gi, function(char) {\n    return String.fromCodePoint(char.toUpperCase().charCodeAt() - 65 + 127462);\n  });\n}\n\n// Example usage:\ngetFlag('IN'); // Outputs: 🇮🇳\ngetFlag('us'); // Outputs: 🇺🇸\ngetFlag('Ru'); // Outputs: 🇷🇺\ngetFlag('nK'); // Outputs: 🇳🇰\n```\n\n### str2bin \u0026 bin2str\n\n[![Shorts Views](https://img.shields.io/youtube/views/9yoKPiN0LTU?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/9yoKPiN0LTU)\n[![Shorts Likes](https://img.shields.io/youtube/likes/9yoKPiN0LTU?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/9yoKPiN0LTU)\n[![Shorts Comments](https://img.shields.io/youtube/comments/9yoKPiN0LTU?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/9yoKPiN0LTU)\n\nWatch video shorts on youtube click: [Watch Now](https://www.youtube.com/shorts/9yoKPiN0LTU)\n\n```js\n/**\n * str2bin — Convert String to Binary\n * @param {string} str\n * @returns Binary code\n */\nfunction str2bin(str) {\n  return str.replace(/./gs, rcFunc(true)).trim();\n}\n\n/**\n * bin2str — Convert Binary to String\n * @param {string} bin\n * @returns Readable text\n */\nfunction bin2str(bin) {\n  return bin.replace(/[01]+[\\x20]?/g, rcFunc(false));\n}\n\n/**\n * rcFunc — Replace Callback Function\n * @param {boolean} encoding\n * @return Binary or Readable text\n */\nfunction rcFunc(encoding) {\n  return function(m) {\n    return encoding ? m.charCodeAt().toString(2).padStart(8, '0') + ' ' : String.fromCharCode(parseInt(m, 2));\n  };\n}\n\n// Example usage:\nstr2bin('Welcome to my YT Channel');\n// Outputs: 01010111 01100101 01101100 01100011 01101111 01101101 01100101 00100000 01110100 01101111 00100000 01101101 01111001 00100000 01011001 01010100 00100000 01000011 01101000 01100001 01101110 01101110 01100101 01101100\n\nbin2str('01010111 01100101 01101100 01100011 01101111 01101101 01100101 00100000 01110100 01101111 00100000 01101101 01111001 00100000 01011001 01010100 00100000 01000011 01101000 01100001 01101110 01101110 01100101 01101100');\n// Outputs: 'Welcome to my YT Channel'\n```\n\n### decbin \u0026 bindec\n\n[![Shorts Views](https://img.shields.io/youtube/views/20v-hCx7fok?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/20v-hCx7fok)\n[![Shorts Likes](https://img.shields.io/youtube/likes/20v-hCx7fok?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/20v-hCx7fok)\n[![Shorts Comments](https://img.shields.io/youtube/comments/20v-hCx7fok?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/20v-hCx7fok)\n\nWatch video shorts on youtube click: [Watch Now](https://www.youtube.com/shorts/20v-hCx7fok)\n\n```js\n/**\n * decbin — Convert Decimal to Binary\n * @param {number} num\n * @returns Binary format 0101011\n */\nfunction decbin(num) {\n  return num.toString(2);\n}\n\n/**\n * bindec — Convert Binary to Decimal\n * @param {string} bin\n * @returns decimal number\n */\nfunction bindec(bin) {\n  return parseInt(bin, 2);\n}\n\n// Example usage:\ndecbin(348374347384);                              // Outputs: '101000100011100101110101010111001111000'\nbindec('101000100011100101110101010111001111000'); // Outputs: 348374347384\n```\n\n### dechex \u0026 hexdec\n\n[![Shorts Views](https://img.shields.io/youtube/views/YBjTnFVOXEE?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/YBjTnFVOXEE)\n[![Shorts Likes](https://img.shields.io/youtube/likes/YBjTnFVOXEE?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/YBjTnFVOXEE)\n[![Shorts Comments](https://img.shields.io/youtube/comments/YBjTnFVOXEE?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/YBjTnFVOXEE)\n\nWatch video shorts on youtube click: [Watch Now](https://www.youtube.com/shorts/YBjTnFVOXEE)\n\n```js\n/**\n * dechex — Decimal to Hex Convertation\n * @param {number} num\n * @returns\n */\nfunction dechex(num) {\n  return num.toString(16);\n}\n\n/**\n * hexdec — Hex to Decimal Convertation\n * @param {string} hex\n * @returns\n */\nfunction hexdec(hex) {\n  return parseInt(hex, 16);\n}\n\n// Example usage:\ndechex(16777215); // Outputs: 'ffffff'\nhexdec('ffffff'); // Outputs: 16777215\n```\n\n### formatMemunit\n\n[![Shorts Views](https://img.shields.io/youtube/views/TeawybFGvzk?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/TeawybFGvzk)\n[![Shorts Likes](https://img.shields.io/youtube/likes/TeawybFGvzk?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/TeawybFGvzk)\n[![Shorts Comments](https://img.shields.io/youtube/comments/TeawybFGvzk?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/TeawybFGvzk)\n\nWatch video shorts on youtube click: [Watch Now](https://www.youtube.com/shorts/TeawybFGvzk)\n\n```js\n/**\n * formatMemunit — Create a memory unit formatter\n * @param {number} bytes\n * @return formatted memory unit\n */\nfunction formatMemunit(bytes) {\n  var factor, units = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];\n\n  factor = Math.floor(Math.log(bytes) / Math.log(1024));\n\n  return (Math.round(bytes / Math.pow(1024, factor) * 100) / 100) + ' ' + units[factor];\n}\n\n// Example usage:\nformatMemunit(583462344);        // Outputs: 556.43 MB\nformatMemunit(43223);            // Outputs: 42.21 KB\nformatMemunit(432);              // Outputs: 432 B\nformatMemunit(8274264242473);    // Outputs: 7.53 TB\nformatMemunit(13462490534);      // Outputs: 12.54 GB\nformatMemunit(3346249053473485); // Outputs: 2.97 PB\n```\n\n### dec2Oct \u0026 oct2Dec\n\n[![Shorts Views](https://img.shields.io/youtube/views/q5I141s3CiA?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/q5I141s3CiA)\n[![Shorts Likes](https://img.shields.io/youtube/likes/q5I141s3CiA?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/q5I141s3CiA)\n[![Shorts Comments](https://img.shields.io/youtube/comments/q5I141s3CiA?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/q5I141s3CiA)\n\nWatch video shorts on youtube click: [Watch Now](https://www.youtube.com/shorts/q5I141s3CiA)\n\n```js\n/**\n * dec2oct — Convert Decimal to Octal\n * @param {number} value\n * @returns A octal number\n */\nfunction dec2oct(value) {\n  return parseInt(value.toString(8));\n}\n\n/**\n * oct2dec — Convert Octal to Decimal\n * @param {number} value\n * @returns A decimal number\n */\nfunction oct2dec(value) {\n  return parseInt(value, 8);\n}\n\n// Example usage:\ndec2oct(299); // Outputs: 453\noct2dec(453); // Outputs: 299\n```\n\n### generatedOTP\n\n[![Shorts Views](https://img.shields.io/youtube/views/SYq9KRBvBmw?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/SYq9KRBvBmw)\n[![Shorts Likes](https://img.shields.io/youtube/likes/SYq9KRBvBmw?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/SYq9KRBvBmw)\n[![Shorts Comments](https://img.shields.io/youtube/comments/SYq9KRBvBmw?style=flat-square\u0026logo=youtube)](https://www.youtube.com/shorts/SYq9KRBvBmw)\n\nWatch video shorts on youtube click: [Watch Now](https://www.youtube.com/shorts/SYq9KRBvBmw)\n\n```js\n/**\n * generateOTP — Generate Random Numeric OTP\n * @param {number} length\n * @returns A random generated OTP\n */\nfunction generateOTP(length) {\n  return String(Math.floor(Math.random() * Math.pow(10, length))).padStart(length, '0');\n}\n\n// Generate OTP of 6-digits\ngenerateOTP(6); // Outputs: 991229\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Findianmodassir%2Fshorts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Findianmodassir%2Fshorts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Findianmodassir%2Fshorts/lists"}