Answers for "camelcase in js"

2

camelcase to hyphenated javascript

let dashed = camel.replace(/[A-Z]/g, m => "-" + m.toLowerCase());
Posted by: Guest on July-07-2020
2

js camel case to snake case

var s1 = 'someTextHere';
var o1 = s1.split(/(?=[A-Z])/).join('_').toLowerCase();
Posted by: Guest on March-20-2020
1

camel case in javascript

const sentence = 'The quick brown fox jumps over the lazy dog.';
console.log(sentence.toUpperCase());
// expected output: "THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG."
Posted by: Guest on July-13-2021
0

javascript to camelcase

String.prototype.toCamelCase = function () {
	let STR = this.toLowerCase()
		.trim()
		.split(/[ -_]/g)
		.map(word => word.replace(word[0], word[0].toString().toUpperCase()))
		.join('');
	return STR.replace(STR[0], STR[0].toLowerCase());
};
Posted by: Guest on August-01-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language