News for hackers. Stuff that matters.
Re:Show HN: A JavaScript function that looks and behaves lik... by williamcotton on Wednesday September 27, 2023 @09:28AM (#37674368)

  value.indent()
    .exclaim()
    .reverse()
    .underline()
    .capitalize()
There’s always the OOP version of method chaining!
Re:Show HN: A JavaScript function that looks and behaves lik... by jonahx on Wednesday September 27, 2023 @10:08AM (#37674879)
This won't look as good when you include all the boilerplate which defines those methods, and which needs to be repeated or otherwise included for every "value" type. You don't have to worry about this when they are pure utility functions.
Re:Show HN: A JavaScript function that looks and behaves lik... by mhink on Wednesday September 27, 2023 @02:23PM (#37678960)
Which is great until Prettier, in its infinite wisdom, decides it's better to stick four of these function invocations on one line and two on the next, so you have an obnoxious mishmash of tokens!
Re:Show HN: A JavaScript function that looks and behaves lik... by pzmarzly on Wednesday September 27, 2023 @02:57PM (#37679518)
Which is a problem of Prettier. I wish for the day that someone builds rustfmt but for Typescript, I will happily leave Prettier and StandardJS behind.

I think it could be done today with a (big) number of ESLint plugins.