¿Qué es este extraño código? [cerrado]
Frecuentes
Visto 82 equipos
-8
I have stumbled across this code:
"".length
It should obviously return 0, but for some reason returns 1337. Is this some kind of trick i dont know?
1 Respuestas
6
El código es:
- Cotización abierta
- Unicode Character 'ACTIVATE ARABIC FORM SHAPING' (U+206D) × 1337
- Cerrar cita
.length
Since the string is made of 1337 "invisible" characters, the length is 1337.
contestado el 28 de mayo de 14 a las 14:05
Thank you for not being mean! - Wazzaps
@Dvidunis Downvoting != being mean. It just means your question kinda sucks :p - Niet el oscuro Absol
I meant the comments.. - Wazzaps
No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas javascript or haz tu propia pregunta.
¿Acaso te has sordeado intencionalmente put 1337 invisible characters in there? (specifically, U+206d) - tckmn
It is ¡cero! jsfiddle.net/6CPK4 or maybe not! jsfiddle.net/6CPK4/1 - Matteo Tassinari
i would say the expected result is weird - Prabhu Murthy
@MatteoTassinari this is the JS violín with the OP's string copy/pasted into it. It shows the 1337 length. - lurker
The effect is kind of ruined when your browser fails to perform font substitution and instead renders 1337 little "unknown character" boxes XD - Niet the Dark Absol