Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

convert a string in snake case to camel case js, snake case to camel case js

const snakeToCamelCase = (s) =>
  s.toLowerCase().replace(/(_w)/g, (w) => w.toUpperCase().substr(1));
const str1 = 'learn_javascript';
console.log(snakeToCamelCase(str1)); // learnJavaScript
 
PREVIOUS NEXT
Tagged: #convert #string #snake #case #camel #case #snake #case #camel #case #js
ADD COMMENT
Topic
Name
9+1 =