Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Javascript Utility Code Tip #145

Open
gloriaJun opened this issue May 2, 2022 · 1 comment
Open

Javascript Utility Code Tip #145

gloriaJun opened this issue May 2, 2022 · 1 comment
Assignees

Comments

@gloriaJun
Copy link
Owner

gloriaJun commented May 2, 2022

Generate Unique string key

const uid = () => {
   const val1 = Date.now().toString(36);
   const val2 = Math.random().toString(36).substr(2);
   return val1 + val2;
}
@gloriaJun gloriaJun self-assigned this May 2, 2022
@gloriaJun gloriaJun changed the title Generate Unique string key Javascript Utility Code Tip May 2, 2022
@gloriaJun
Copy link
Owner Author

Reverse String

const reverse = (txt) => {
   let text = txt;
   return text.split('').reverse().join('');
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant