News for hackers. Stuff that matters.
Re:I loved jQuery, and still do (2019) by gunapologist99 on Tuesday June 29, 2021 @01:15PM (#27678844)
True, but jQuery does a lot more than just id selection with $!

You could just extend the function to detect '.' vs '#', and do a class selection as well. And then add all of the selectors, subselectors, etc. (similar to, but far more powerful than css3's selectors.) and if you go far enough, you reinvented zepto (but still a long way from jQuery)

(actually, since $ is basically synonymous with jQuery, it'd probably be better to choose a different function name. too bad you can't define it as #(id).)

Re:I loved jQuery, and still do (2019) by recursive on Tuesday June 29, 2021 @01:58PM (#27679454)
> True, but jQuery does a lot more than just id selection with $!

Yes. For a high degree of jquery-compatibility, you can use my library.

    const $ = document.querySelectorAll.bind(document);
Re:I loved jQuery, and still do (2019) by goldenkey on Tuesday June 29, 2021 @03:42PM (#27680782)
This comment made me spit my drink out. People forget about bind, it's nice to replace the old closure patterns.