Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
ValdesDev wants to merge9 commits intoironhack-labs:masterfromValdesDev:master

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 :)

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

JavaScript types

El set de tipos en JavaScript consiste devalores primitivos yobjetos

Tipos primitivos:

    Boolean     Null     Undefined     Number     BigInt     String     Symbol

Todo lo que no son tipos primitivos sonobjetos, 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 commentedOct 24, 2021 via email

Hola Sherab,gracias por el feedback. He puesto un comentario en la PR porque no veo elerror.Muchas gracias por la ayuda.El dom, 24 oct 2021 a las 11:49, ta-webft-es-rmt ***@***.***>)escribió:
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' <https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/throw> . Todo correcto, sigue así!. — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub <#2643 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AVZDNL4PSUNLD55IE6ULZPLUIPJBBANCNFSM5GMKISHQ> . Triage notifications on the go with GitHub Mobile for iOS <https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or Android <https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.

@stale
Copy link

stalebot commentedNov 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.

@stalestalebot added the stale labelNov 25, 2021
@stale
Copy link

stalebot commentedApr 17, 2022

This pull request is closed. Thank you.

@stalestalebot closed thisApr 17, 2022
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@ta-webft-es-rmtta-webft-es-rmtta-webft-es-rmt left review comments

Assignees
No one assigned
Labels
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@ValdesDev@ta-webft-es-rmt

[8]ページ先頭

©2009-2025 Movatter.jp