¡GoConqr estrena diseño! Cuéntanos qué te parece.

Fichas

Weird Behavior

milly larcen Weird Behavior Inglés 5 fichas

Fichas del conjunto (5)

  1. 1'b' + 'a' + + 'a' + 'a'; //'BaNaNa' ('b' + 'a' + + 'a' + 'a').toLowerCase() //bananaThe expression is evaluated as ‘ba’ + (+’a’), which converts +’a’ to not a number. Then the expression NaN+’a’ is evaluated as NaNa, and the final result is baNaNa
  2. 2Note: The !! operator converts an object to a boolean value. Null is a falsy value, but it’s not equal to false. !!null; //false null == false; //falseYou cannot convert null (and undefined) to any other value before comparing equality, so null == false is equal to false.
  3. 3An array and an empty array is always a truthy value, but it’s not equal to true. !![ ] //true [ ] == true //falseTrue is converted to 1 and [ ] is converted to 0 so[ ] ==true (0 == 1) is equal to false.
  4. 4[9, 8, 7] + [6, 5, 4] //"9,8,76,5,4"This result occurs because when you sum two collections, the “toString” is called in each array, so [9,8,7] is converted to “9,8,7” and [6,5,4] is convert to “6,5,4,” and then the concatenation happens.
  5. 5typeof(undefined) "undefined" typeof(null) "object"This behavior is a side effect of the first implementation of JavaScript. Values were represented as a type tag plus the value. However, null was served with a NULL pointer. The type tag for objects was 0. As a result, null is also interpreted as an object.

Información

Descripción
Weird Behavior Fichas sobre Weird Behavior, creado por milly larcen el 14/04/2020.
Creado por
milly larcen
Visitas
0
Valoración

Escríbenos

¿Sobre qué es tu mensaje?

¿Qué te parece el nuevo diseño?

¿Te gusta?