js camel case to snake case
snippet in javascript

js camel case to snake case

user2882

var s1 = 'someTextHere';
var o1 = s1.split(/(?=[A-Z])/).join('_').toLowerCase();