Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const randomString = () => Math.random().toString(36).slice(2);
- const escape = (str) => str.replace(/[&<>"']/g, (m) => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' }[m]));
- const capitalize = (str) => str.toLowerCase().replace(/^(.)|\s+(.)/g, (c) => c.toUpperCase());
- const camelCase = (str) => str.trim().replace(/[-_\s]+(.)?/g, (_, c) => (c ? c.toUpperCase() : ''));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement