What do you want to save?
Add Code snippet
New code examples
-
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 -
Java 2021-09-26 10:59:05
how to loop through an 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 -
Javascript 2021-09-25 23:24:02
javascript making a tag game
<!-- A SIMPLE SNAKE GAME MADE BY HTML AND CSS --> <!DOCTYPE html> <html> <head> <title></title> <style> html, body { height: 100%; margin: 0; } body { background: black; display: flex;... Add solution -
Java 2021-09-25 18:35:05
Java sort Map by values
Map<String, Integer> unSortedMap = getUnSortedMap(); System.out.println("Unsorted Map : " + unSortedMap); //LinkedHashMap preserve the ordering of elements in which they are ins... Add solution -
Javascript 2021-09-25 09:29:03
loop through javascript 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 -
Javascript 2021-09-21 17:01:02
with javascript, can html markup be added in a text string?
const text = 'This is a test to see whether nested style spans work properly.' const styling = [ {start: 22, end: 54, type: "strong"}, {start: 30, end: 36, type: "a"}, {start: 37, end: 48, type: "em"}, {start: 43, end... Add solution -
Javascript 2021-09-20 02:58:03
getdata from fetch api into variable
<script> function getFromAPI(url, callback){ var obj; fetch(url) .then(res => res.json()) .then(data => obj = data) .then(() => callback(obj)) } getFromAPI('https://jsonplaceholder.typicode.com/posts', getData); function ... Add solution
Best helpers
Hwsolutions
+5
SYJ
+5
KMC
+5
Jonjie
+5
Frank Jaeger
+5
Paul Knight
+5
Required
+5
Saylestyler
+5
Deverejones
+5