Twitter | Pretraživanje | |
Cristian Bote ⚛️ 26. stu
Odgovor korisniku/ci @jviide @WebReflection
Hmm 🤔 now I'm intrigued! What kind of sorcery you've used for the loop? SVGs?
Reply Retweet Označi sa "sviđa mi se"
Joachim Viide 26. stu
Odgovor korisniku/ci @cristianbote_ @WebReflection
A magician never reveals their secrets 😉 (It's text-on-a-path, just conveniently twisted around to meet itself in the middle. Compression artifacts are great for obscuring shoddy seams!)
Reply Retweet Označi sa "sviđa mi se"
Mike Barkmin 🐧 27. stu
Odgovor korisniku/ci @jviide @_developit
I guess it is a very simple rule. JavaScript uses the type of first term for the comparison. So JavaScript will try to convert the second term to this type. Thus, we compare a < b (String), b < c (Number), c < a (String).
Reply Retweet Označi sa "sviđa mi se"
Joachim Viide 27. stu
Odgovor korisniku/ci @mikebarkmin @_developit
IIRC numeric values take precedence over strings here, so in a < b the a is coerced to a number. But yeah, otherwise that's the gist of it 🙂
Reply Retweet Označi sa "sviđa mi se"
Marko Laakso 26. stu
Odgovor korisniku/ci @jviide
I suspect Bach just came up with something based on your tweet, Per Tonos they say.
Reply Retweet Označi sa "sviđa mi se"
Joachim Viide 26. stu
Odgovor korisniku/ci @ikisusi
Reply Retweet Označi sa "sviđa mi se"
Emmie Päivärinta 27. stu
Odgovor korisniku/ci @jviide @_developit
It works because the last one compares strings, while the others cast strings to numbers, right?
Reply Retweet Označi sa "sviđa mi se"
Joachim Viide 27. stu
Odgovor korisniku/ci @EmmiePaivarinta @_developit
Yup!
Reply Retweet Označi sa "sviđa mi se"
rong-sen 27. stu
Odgovor korisniku/ci @jviide
I guess it is a matter of comparing numbers or strings.
Reply Retweet Označi sa "sviđa mi se"
Joachim Viide 27. stu
Odgovor korisniku/ci @igarshmyb
Indeed: if one operand is a string and the one is a number then they're both compared as numbers.
Reply Retweet Označi sa "sviđa mi se"