Extenza-Academy / WebDev-100_2021-Q1

24 Lessons, 12 Weeks, Get Started as a Web Developer
2 stars 0 forks source link

2.1.3. Challenge #23

Closed mserykh closed 3 years ago

mserykh commented 3 years ago

🚀 Challenge

JavaScript is notorious for its surprising ways of handling datatypes on occasion. Do a bit of research on these 'gotchas'. For example: case sensitivity can bite! Try this in your console: let age = 1; let Age = 2; age == Age (resolves false -- why?). What other gotchas can you find?

mserykh commented 3 years ago
  1. age !== Age, because JS is case sensitive
  2. -0 === +0, 0 is only one integer with 2 representations
  3. NaN type is a number
  4. undefined type is object
dev-experience commented 3 years ago
mserykh commented 3 years ago
  • No. 1: That's not the reason ;)
  • No. 4: Why do you say so? How can you prove it?

Yeahhh...So stupid of me :|

mserykh commented 3 years ago
  1. age != Age, because 1 != 2

  2. undefined type is undefined. How to check it:

    console.log(typeof indefined);
dev-experience commented 3 years ago

Cool!