Forem

Cover image for Resolvendo exercícios do JSchallenger - (Javascript Basics #2)
ananopaisdojavascript
ananopaisdojavascript

Posted on • Edited on

3 2

Resolvendo exercícios do JSchallenger - (Javascript Basics #2)

O que deve ser feito aqui?

  • Escrever uma função que receba dois valores (a e b)
  • Essa função deve retornar true se o valor e o tipo forem os mesmos, o que significa que devemos usar os operadores de estrita igualdade.

Só para lembrar:

Operadores de igualdade == consideram apenas os valores.
Operadores de estrita igualdade === consideram valores e tipos.

function myFunction(a, b) {
    return a === b
}
Enter fullscreen mode Exit fullscreen mode

Resultados

myFunction(2, 3) // false
myFunction(3, 3) // true
myFunction(1, '1') // false
myFunction('10', '10') // true
Enter fullscreen mode Exit fullscreen mode

Para quem quiser resolver o desafio, o link está aqui:

Comparison operators, strict equality

Gostou? Até a próxima anotação! :)

Top comments (0)

Image of Docusign

🛠️ Bring your solution into Docusign. Reach over 1.6M customers.

Docusign is now extensible. Overcome challenges with disconnected products and inaccessible data by bringing your solutions into Docusign and publishing to 1.6M customers in the App Center.

Learn more

👋 Kindness is contagious

Explore a sea of insights with this enlightening post, highly esteemed within the nurturing DEV Community. Coders of all stripes are invited to participate and contribute to our shared knowledge.

Expressing gratitude with a simple "thank you" can make a big impact. Leave your thanks in the comments!

On DEV, exchanging ideas smooths our way and strengthens our community bonds. Found this useful? A quick note of thanks to the author can mean a lot.

Okay