What do you want to save?
Add Code snippet
New code examples
-
Javascript 2021-10-13 09:43:03
js rgba to hex
function rgbToHex(r, g, b) { return "#" + ((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1); } function hexToRgb(hex) { var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex); if(result){ var... Add solution -
Javascript 2021-10-12 23:17:06
js first letter to uppercase
//capitalize only the first letter of the string. function capitalizeFirstLetter(string) { return string.charAt(0).toUpperCase() + string.slice(1); } //capitalize all words of a string. function capitalizeWords(string) { return string.repl... Add solution -
Javascript 2021-10-10 02:57:03
capitalize algorithm
function capitalize1(str) { const arrOfWords = str.split(" "); const arrOfWordsCased = []; for (let i = 0; i < arrOfWords.length; i++) { const word = arrOfWords[i]; arrOfWordsCased.push(word[0].toUpperCase() + word.slice(1).toL... Add solution -
Javascript 2021-10-09 13:07:06
capitalize a string javascript
//capitalize only the first letter of the string. function capitalizeFirstLetter(string) { return string.charAt(0).toUpperCase() + string.slice(1); } //capitalize all words of a string. function capitalizeWords(string) { return string.repl... Add solution -
Javascript 2021-10-07 20:21:03
document.createelement options list
document.getElementById('generate').onclick = function() { var values = ["dog", "cat", "parrot", "rabbit"]; var select = document.createElement("select"); ... Add solution -
Other 2021-10-07 10:25:04
string capitalize first letter
//capitalize only the first letter of the string. function capitalizeFirstLetter(string) { return string.charAt(0).toUpperCase() + string.slice(1); } //capitalize all words of a string. function capitalizeWords(string) { return string.repl... Add solution -
Javascript 2021-10-06 11:13:04
javascript consecutive numbers in array
/** * Given an array of number, group algebraic sequences with d=1 * [1,2,3,4,5,6] => true * [1,2,4,5,6] => false */ var arr = [1,2,4,5,6]; const differenceAry = arr.slice(1).map(function(n, i) { return n - arr[i]; }) const isDifference= dif... Add solution
Best helpers
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5