Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

102
Views
Estructura del código que no entiendo. Ayuda para identificarlo

Recientemente encontré esta estructura de código () => {} en el siguiente fragmento de código

 import { Server } from "socket.io"; const io = new Server(3000); io.on("connection", (socket) => { // send a message to the client socket.emit("hello from server", 1, "2", { 3: Buffer.from([4]) }); // receive a message from the client socket.on("hello from client", (...args) => { // ... }); });

Pero no entiendo qué es esta estructura de código. ¿Tienes alguna referencia que pueda usar para aprender sobre esto?

about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Esa es una función de flecha utilizada en javascript. Puede obtener información adicional aquí . Básicamente su equivalente con las funciones tradicionales sería:

 import { Server } from "socket.io"; const io = new Server(3000); io.on("connection", function (socket){ // send a message to the client socket.emit("hello from server", 1, "2", { 3: Buffer.from([4]) }); // receive a message from the client socket.on("hello from client", function (...args){ // ... }); });
about 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!