- Notifications
You must be signed in to change notification settings - Fork6.7k
[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
Uh oh!
There was an error while loading.Please reload this page.
Conversation
ta-webft-es-rmt commentedOct 24, 2021
JavaScript types El set de tipos en JavaScript consiste devalores primitivos yobjetos Tipos primitivos:
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"); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
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>. |
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. |
This pull request is closed. Thank you. |
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 :)