What do you want to save?
Add Code snippet
New code examples
-
Javascript 2021-11-13 11:44:18
loop through an array javascript
var data = [1, 2, 3, 4, 5, 6]; // traditional for loop for(let i=0; i<=data.length; i++) { console.log(data[i]) // 1 2 3 4 5 6 } // using for...of for(let i of data) { console.log(i) // 1 2 3 4 5 6 } // using for...in for(let i in data) { con... Add solution -
Javascript 2021-11-13 09:05:20
loop through array javascript
var data = [1, 2, 3, 4, 5, 6]; // traditional for loop for(let i=0; i<=data.length; i++) { console.log(data[i]) // 1 2 3 4 5 6 } // using for...of for(let i of data) { console.log(i) // 1 2 3 4 5 6 } // using for...in for(let i in data) { con... Add solution -
Python 2021-11-13 08:36:19
python how to askopenfilename for multiple files
#So, you now how to do askopenfilename, the plural of it is askopenfilenames lol #Super cliche ikr. But yeah that is it, instead of askopenfilename do askopenfilenames import Tkinter root = tk.Tk() files = fd.askopenfilenames([the stuff you need]) #It i... Add solution -
Javascript 2021-11-12 23:45:09
JS array clear
let aray = [1,2,3,4,5,6,7,8,9,10]; //as with most coding there are several ways you can do anything //see whichever works best for your scenario //set the array to equal a blank array array = []; //set the array's length to 0 array.length = 0; //using... Add solution -
Javascript 2021-11-12 18:05:16
javascript through array
var data = [1, 2, 3, 4, 5, 6]; // traditional for loop for(let i=0; i<=data.length; i++) { console.log(data[i]) // 1 2 3 4 5 6 } // using for...of for(let i of data) { console.log(i) // 1 2 3 4 5 6 } // using for...in for(let i in data) { con... Add solution -
Other 2021-11-12 09:20:36
My favourite use of this function is converting a string to an array, trimming each line and removing empty lines:
<?php $array = array_filter(array_map('trim', explode("\n", $string)), 'strlen'); ?> Although it states clearly that array keys are preserved, it's important to note this includes numerically indexed arrays. You can't use a for loop on ... Add solution -
C++ 2021-11-11 10:42:07
implementing a scrabble in C++
//board.cpp #include "board.h" CBoard::CBoard() { xmax = ymax = 15; firstword = FALSE; //create the initial tile set and put them in the tilebag list char tile_letters[26] = {'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q',... Add solution
Best helpers
Czlsws
+5
Shahruz Raad
+5
Horse
+5
Csandreas1
+5
SOUMEN
+5
Vy32
+5
Anugram
+5
ImMathan
+5
Joyo
+5
Huggy Buggy
+5