Skip to content

Instantly share code, notes, and snippets.

@teffcode
Created March 21, 2021 07:12
Show Gist options
  • Save teffcode/aa8fb864da8d1821aa222df3e0361461 to your computer and use it in GitHub Desktop.
Save teffcode/aa8fb864da8d1821aa222df3e0361461 to your computer and use it in GitHub Desktop.

馃憢馃徏 Welcome 馃憢馃徏

Quiz banner

Instagram | Twitter | LinkedIn


Choose your language 馃憛



English version 馃殌


For the following code, which method would ["馃悞馃崒", "馃馃崒"] print: A, B or C ?


Click here to see the correct answer and explanation 馃憖
Correct Answer Explanation
C The map() method creates a new array populated with the results of calling a provided function on every element in the calling array. What would be the difference with the forEach() method?

Explanation based on 馃憠馃徏 Array.prototype.map() | MDN


Code:

const monkeys = ["馃悞", "馃"]._____(m => m + "馃崒");

console.log(monkeys);

// ["馃悞馃崒", "馃馃崒"]


Spanish version 馃殌


Para el siguiente c贸digo, 驴qu茅 m茅todo imprimir铆a ["馃悞馃崒", "馃馃崒"]: A, B o C?


Haz click aqu铆 para ver la respuesta correcta y su explicaci贸n 馃憖
Respuesta correcta Explicaci贸n
C El m茅todo map() crea un nuevo array con los resultados de la llamada a la funci贸n indicada aplicados a cada uno de sus elementos. 驴Cu谩l ser铆a la diferencia con el m茅todo forEach()?

Explicaci贸n basada en 馃憠馃徏 Array.prototype.map() | MDN


C贸digo:

const monkeys = ["馃悞", "馃"]._____(m => m + "馃崒");

console.log(monkeys);

// ["馃悞馃崒", "馃馃崒"]


@Jussef
Copy link

Jussef commented Mar 23, 2021

eehhh Super!! 馃憦馃徏 Esta padre

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment