DEV Community

Cover image for Changelog: Stack Overflow Liquid Tag

Changelog: Stack Overflow Liquid Tag

Ben Halpern on August 15, 2019

We are pleased to introduce the Stack Overflow and Stack Exchange liquid tags. These embeds, assembled in native HTML within posts (as opposed to i...
Collapse
 
pixmy profile image
Arturo Cabrera

"Why is the result of ('b'+'a'+ + 'a' + 'a').toLowerCase() 'banana'?"

hahahahaha I'm dying

Collapse
 
ben profile image
Ben Halpern The DEV Team

That is just the kind of Stack content I hope this feature will help bump 😄

The answer is pretty great

+'a' resolves to NaN ("Not a Number") because it coerces a string to a number, while the character a cannot be parsed as a number

console.log(+'a')
To lowercase it becomes banana.

Adding NaN to "ba" turns NaN into the string "NaN" due to type…

Collapse
 
ben profile image
Ben Halpern The DEV Team

There are a lot of gems on Stack Overflow waiting to be bumped, like this thread about sorting socks...

How to pair socks from a pile efficiently?

3812

Yesterday I was pairing the socks from the clean laundry and figured out the way I was doing it is not very efficient. I was doing a naive search — picking one sock and "iterating" the pile in order to find its pair. This requires iterating over n/2 * n/4…

Collapse
 
yechielk profile image
Yechiel Kalmenson

Awesome!

I know at least one of my old answers that I need to edit now...

Collapse
 
ctrlsquid profile image
zach

I think a feature like this will really help the community. It's one thing for someone to comment "duplicate" and you feel punished for it. It's another thing to be like "this was answer here on this other answer, check it out!"

Collapse
 
jeddevs profile image
Theo

Can I get a hip hip hooray?