What do you want to save?
Add Code snippet
New code examples
-
Javascript 2021-10-23 16:52:08
putting a loop into an array javascript
let array = ['Item 1', 'Item 2', 'Item 3']; // Here's 4 different ways for (let index = 0; index < array.length; index++) { console.log(array[index]); } for (let index in array) { console.log(array[index]); } for (let value of array) { console... Add solution -
Javascript 2021-10-20 21:48:05
iterate array javascript
let array = ['Item 1', 'Item 2', 'Item 3']; // Here's 4 different ways for (let index = 0; index < array.length; index++) { console.log(array[index]); } for (let index in array) { console.log(array[index]); } for (let value of array) { console... Add solution -
TypeScript 2021-10-12 07:48:07
react setstate in hooks to array of objects value
const[array,setArray]= useState([ {id: 1, value: "a string", othervalue: ""}, {id: 2, value: "another string", othervalue: ""}, {id: 3, value: "a string", othervalue: ""},... Add solution -
Javascript 2021-10-01 04:20:04
traverse an array in javascript
let array = ['Item 1', 'Item 2', 'Item 3']; // Here's 4 different ways for (let index = 0; index < array.length; index++) { console.log(array[index]); } for (let index in array) { console.log(array[index]); } for (let value of array) { console... Add solution -
C++ 2021-09-26 21:56:02
how to make a selection sort C++
void selectionSort(int array[], int size) { int minIndex, minValue; for (int start = 0; start < (size - 1); start++) { minIndex = start; minValue = array[start]; for (int index = start + 1; index < size; index++) { if (array[index] &l... Add solution -
Javascript 2021-09-15 07:51:04
how to iterate array in javascript
let array = ['Item 1', 'Item 2', 'Item 3']; // Here's 4 different ways for (let index = 0; index < array.length; index++) { console.log(array[index]); } for (let index in array) { console.log(array[index]); } for (let value of array) { console... Add solution -
-
Other 2021-09-05 10:32:02
find element in an array and replace it by a callback function
var charSets = new Array("ab","bb","cd","ab","cc","ab","dd","ab"); function replaceElement(element,index,array) { if (element == "ab") array[index] = "**&qu... Add solution