What do you want to save?
Add Code snippet
New code examples
-
Javascript 2022-01-26 05:02:14
find capital word in 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 2022-01-26 01:46:27
javascript split array into chunks of
function splitArrayIntoChunksOfLen(arr, len) { var chunks = [], i = 0, n = arr.length; while (i < n) { chunks.push(arr.slice(i, i += len)); } return chunks; } var alphabet=['a','b','c','d','e','f']; var alphabetPairs=splitArrayIntoC... Add solution -
Javascript 2022-01-23 00:20:50
return first letter of string javascript in 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 2022-01-22 17:41:29
es6 reverse foreach
var arr = [1, 2, 3, 4, 5]; arr.slice().reverse() .forEach(function(item) { console.log(item);  ... Add solution -
Javascript 2022-01-22 09:45:12
array index javascript show only first 2 elements
array.slice(0, n); Add solution -
Javascript 2021-12-23 16:08:11
javascript how to get every element after the 1st in an array
var arguments = ['One', 'Two', 'Three']; var middle = arguments.slice(1, -1); // will take away the 1st from the start and the 1st from the end console.log(middle); // once logged it will only show 'Two' Add solution