Skip to content

[FT-RMT-102021] JoseL_Valdes #2643

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 9 commits into from
Closed

Conversation

ValdesDev
Copy link

Por favor, me gustaría saber como resolver el fallo que da en la Iteration #3:, cuando en el array que se pasa como argumento un elemento es un objeto o array.
Gracias :)

@ValdesDev ValdesDev changed the title [FT-RMT-102021] firstName_Valdes [FT-RMT-102021] JoseL_Valdes Oct 20, 2021
@ta-webft-es-rmt
Copy link

JavaScript types

El set de tipos en JavaScript consiste de valores primitivos y objetos

Tipos primitivos:

    Boolean 
    Null 
    Undefined 
    Number 
    BigInt 
    String 
    Symbol 

Todo lo que no son tipos primitivos son objetos, por lo tanto para saber si el item es un objeto literal o un array usamos el typeof variableName === 'object'. Para lanzar un error usamos el keyword 'throw'.

Todo correcto, sigue así!.

let sumResult = 0;
for (let i = 0; i < numbersArray.length; i++) {
if (typeof numbersArray[i] === 'object') {
throw new Error("Unsupported data type sir or ma'am");
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Creo que aquí ya estoy haciendo lo que me comentaste, pero en el test devuelve error. Por favor, ¿podrías indicarme que está mal?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Si te fijas, el test que fallaba era de la iteración 3.1, la iteración 3 solo tiene que devolver la suma de los numeros en un array y ya lo tenías bien, es el 3.1 sum() donde se pide la comprobación.

@ValdesDev
Copy link
Author

ValdesDev commented Oct 24, 2021 via email

@stale
Copy link

stale bot commented Nov 25, 2021

This pull request has been automatically marked as stale because it didn't have any recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Nov 25, 2021
@stale
Copy link

stale bot commented Apr 17, 2022

This pull request is closed. Thank you.

@stale stale bot closed this Apr 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants