What do you want to save?
Add Code snippet
New code examples
-
Java 2021-11-19 21:49:10
java 8 map foreach
Map<String, Integer> items = new HashMap<>(); items.put("A", 10); items.put("B", 20); items.put("C", 30); items.put("D", 40); items.put("E", 50); items.put("F", 60); items.forEach((k... Add solution -
C# 2021-11-19 07:51:14
tuple parameter name
// Tuples cannot be assigned parameter names. //Instead you could do something like this: (string name, int id) user = ("jack", 1); Console.WriteLine($"{user.name}, {user.id}"); // Output: // jack, 1 // When working with lists: List... Add solution -
Java 2021-11-17 21:37:15
create stream from array java
// import java.util.Arrays; // import java.util.stream.Stream; String[] array = {"a", "b", "c", "d", "e"}; //Arrays.stream Stream<String> stream1 = Arrays.stream(array); stream1.forEach(x -> Sys... Add solution -
Dart 2021-11-17 07:50:24
search in flutter listview
import 'package:flutter/material.dart';void main() => runApp(new MyApp());class MyApp extends StatelessWidget { // This widget is the root of your application. @override Widget build(BuildContext context) { return new MaterialApp( title: 'Fl... Add solution -
Javascript 2021-11-16 21:07:11
get data from api in javascript
<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 -
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