What do you want to save?
Add Code snippet
New code examples
-
C# 2022-02-09 17:15:01
C# extend array
string[] items = new string[3] { "input1", "input2", "input3" }; string[] moreItems = new string[10] { "input4", "input5" }; // array to list List<string> itemsList = items.ToList<string>(); ... Add solution -
Javascript 2022-02-07 07:45:01
splice
//we can add elements to array using splice const strings=['a','b','c','d'] //go the 2nd index,remove 0 elements and then add 'alien' to it strings.splice(2,0,'alien') console.log(strings) //["a", "b", "alien", "c&quo... Add solution -
C# 2022-02-06 00:50:41
encrypption in C# console using mod of 26
namespace CaesarCipher { class Program { static void Main(string[] args) { // Determining if user wants to encrypt or decrypt. Console.WriteLine("Chose One: Encrypt / Decrypt"); string encryptDecrypt = Console.ReadL... Add solution -
PHP 2022-02-03 09:40:30
php array_walk_recursive
Flatten multidimensional associative array to array function flatten(array $array, $prefix="") { $result = Array(); array_walk($array, function ($value, $key) use ($array, $prefix, &$result) { $path = $prefix ? "$prefix... Add solution -
Other 2022-02-02 22:20:17
randome words api
// GetRandom Words from API and push to Array async function getRandomWord() { const res = await fetch('https://random-words-api.vercel.app/word'); const data = await res.json(); return data[Object.keys(data)[0]].word.toLowerCase(); } getRandomW... Add solution -
Other 2022-02-02 20:06:15
how to check whether the user is online or not using socket.io
const users = {}; io.on('connection', function(socket){ console.log('a user connected'); socket.on('login', function(data){ console.log('a user ' + data.userId + ' connected'); // saving userId to array with socket ID users[socket.id] = da... Add solution -
Other 2022-02-01 13:45:13
array_walk_recursive get return value
Flatten multidimensional associative array to array function flatten(array $array, $prefix="") { $result = Array(); array_walk($array, function ($value, $key) use ($array, $prefix, &$result) { $path = $prefix ? "$prefix... Add solution -
Other 2022-01-31 03:25:11
collection coding interview questions
import java.util.*; public class ArrayListContainsExample { public static void main(String args[]) { // initialize ArrayList ArrayList<Integer> al = new ArrayList<Integer>(); // add elements to ArrayList object ... Add solution