What do you want to save?
Add Code snippet
New code examples
-
Javascript 2022-03-22 13:20:11
creating room in ws node js
const rooms = {}; wss.on("connection", socket => { const uuid = ...; // create here a uuid for this connection const leave = room => { // not present: do nothing if(! rooms[room][uuid]) return; // if the one exiting is t... Add solution -
C 2022-03-20 02:50:05
convert python code to c online
ALGORITMO DECLARE num[5,4] NUMÉRICO num_aux, i, j, k, l, m, n, lin, col NUMÉRICO PARA i ← 1 ATÉ 5 FAÇA INÍCIO PARA j ← 1 ATÉ 4 FAÇA INÍCIO LEIA num_aux IF i = 1 E j = 1 ENTÃO num[i,... Add solution -
Other 2022-03-10 02:40:09
on click unmount the component
import React, { useEffect, useState } from 'react'; import ReactDOM from 'react-dom'; function LifecycleDemo() { // Pass useEffect a function useEffect(() => { // This gets called after every render, by default // (the first one, and every... Add solution -
Javascript 2022-03-02 19:35:22
how to make a deck of cards in javascript
class Deck{ constructor(){ this.deck = []; this.reset(); this.shuffle(); } reset(){ this.deck = []; const suits = ['Hearts', 'Spades', 'Clubs', 'Diamonds']; const values = ['Ace', 2, 3, 4, 5, 6, 7, 8, 9, 10, 'Jack', 'Queen'... Add solution -
C++ 2022-02-26 08:20:05
error: use of parameter outside function body before ] token c++
If you are using GCC, then you are to pass the length of the array as a parameter to the function. void foo (int m, int arr[][m]) { //... } However, there seems to be a bug in either the compiler or the documentation, as the above function prototy... Add solution -
Javascript 2022-02-21 21:20:10
count number of each element in array javascript
var arr = [5, 5, 5, 2, 2, 2, 2, 2, 9, 4]; var counts = {}; for (var i = 0; i < arr.length; i++) { var num = arr[i]; counts[num] ? counts[num] + 1 : 1; } console.log(counts[5], counts[2], counts[9], counts[4]); Add solution
Best helpers
C.B
+5
Beatriz LO
+5
Matt McGuire
+5
Stacey
+5
Dan Aloni
+5
Mostafa 36a2
+5
RiCo
+5
Binarus
+5
Srihari
+5
Khrustzh
+5
Styne666
+5
Siranush A
+5
Newby
+5
Youssef
+5
Ron Short
+5
Cat812
+5
Alkasm
+5
Alexvoda
+5