Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- camelCase to snake_case
- */
- function camelToSnake(str) {
- return str.replace(/([^A-Z])([A-Z])/g, '$1_$2').toLowerCase();
- }
- console.log(camelToSnake('updatedAt'));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement