What do you want to save?
Add Code snippet
New code examples
-
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 -
Python 2021-10-07 02:17:02
python3 slice
word = "Example" # Obtain the first 3 characters of "Example" # E x a m p l e # 0 1 2 3 4 5 6 # First 3 characters = "Exa" sliced_word = word[:3] # Gives you "Exa" # Everything after character #3 = "mple"... 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
Ranking is empty